MySQL Forums
Forum List  »  PHP

Re: Fatal error: Call to undefined function mysql_connect()
Posted by: Christos Koursaros
Date: June 25, 2006 06:09PM

Hi Peter,
sorry for the confusion. I was trying to play with the code and i got confused before!anyway i am using now the following code and i get those warnings:


Warning: mysqli_query() expects at least 2 parameters, 1 given in C:\PHP\phpFiles\mysqli_up.php on line 16

Warning: mysqli_errno() expects exactly 1 parameter, 0 given in C:\PHP\phpFiles\mysqli_up.php on line 18

Warning: mysqli_error() expects exactly 1 parameter, 0 given in C:\PHP\phpFiles\mysqli_up.php on line 19
Error :

-------------------------------------------------
<html>
<head><title>Test MySQL</title></head>
<body>
<!-- mysql_up.php -->
<?php
error_reporting(E_ALL);

$host="localhost";
$user="root";
$password="dobernman";


$connect = mysqli_connect($host,$user,$password);
$sql="show status";
//$result = mysqli_query($connect,$sql);
$result=mysqli_query($sql) ;
if ($result == 0)
echo "<b>Error " . mysqli_errno() . ": "
. mysqli_error() . "</b>";
else
{
?>
<!-- Table that displays the results -->
<table border=”1”>
<tr><td><b>Variable_name</b></td>
<td><b>Value</b></td>
</tr>
<?php
for ($i = 0; $i < mysqli_num_rows($result); $i++) {
echo "<TR>";
$row_array = mysqli_fetch_row($result);
for ($j = 0; $j < mysqli_num_fields($result); $j++)
{
echo "<TD>" . $row_array[$j] . "</td>";
}
echo "</tr>";
}
?>
</table>
<?php } ?>
</body>
</html>

Options: ReplyQuote


Subject
Written By
Posted
Re: Fatal error: Call to undefined function mysql_connect()
June 25, 2006 06:09PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.