how are you? I've been doing some code using "old commands" (or thats what i found) of php version 5. Yesterday i tried to run my program using php version 7 and i was given this alert (this alert does not appear when using php 5): Issue
Fatal error: Uncaught Error: Call to undefined function mysql_connect()
MAMP was running at version 5 (everything was right) but i gotta use the version 7!. Can help me to make my code runs using version 7?. Take a look (index.php)
<?php include('connect.php'); ?>
<html>
<head>
<script src="http://c...content-available-to-author-only...y.com/jquery-latest.min.js" type="text/javascript"></script>
</head>
<body>
<a href="student.php">ADD NEW STUDENT</a><br/><br/>
<h2 align="center">Chart</h2>
<input id="search" type="text">
<table align="center" border="1" cellspacing="0" cellpadding="0" width="700" id="table">
<thead>
<th>id</th>
<th>Subject</th>
<th>Name</th>
<th>Description</th>
<th>Hours</th>
<th>Action</th>
</thead>
<?php
$sql = mysql_query("SELECT * FROM materias");
$i = 1;
while ($row = mysql_fetch_array($sql)) {
echo "<tr>
<td>" . $i . "</td>
<td>" . $row['subject_id'] . "</td>
<td>" . $row['name'] . "</td>
<td>" . $row['description'] . "</td>
<td>" . $row['hours'] . "</td>
<td align='center'>
<a href='editar.php?editar=1&iden=" . $row['id'] . "'>UPDATE</a> |
<a href='borrar.php?borrar=1&iden=" . $row['id'] . "'>DELETE</a>
</td>
</tr>";
$i++;
}
?>
</table>
</body>
</html>
And the other file is connect.php (check the connection with the database)
<?php
$con=mysql_connect('localhost','root','root')OR die('error : '.mysql_error());
$db=mysql_select_db('test');
if($db){
echo 'success';
}else{
echo 'Error :' .mysql_error();
}
?>
Hope you can help me :( Thanks!