Problem with mysql connections
Posted: February 7th, 2017, 12:36 am
Today I`ve installed the php tools.
Simple php code worked fine. Then i want to try to retrieve some info from my db.
Then i`ve started my denwer tool pack, that manage apache.
So where is the problem?
Apache works fine, but every time i try to run this, i get next error
How could i fix this?
Simple php code worked fine. Then i want to try to retrieve some info from my db.
Then i`ve started my denwer tool pack, that manage apache.
So where is the problem?
- Code: Select all
<?php
mysql_connect("localhost","root","") or die("Could not connect: ".mysql_error());
mysql_select_db("mydb");
$sql="SELECT * FROM table1";
$reuslt=mysql_query($sql);
while($row=mysql_fetch_array($reuslt,MYSQL_ASSOC))
{
echo $row['id'].':'.$row['text']."<br/>";
}
?>
Apache works fine, but every time i try to run this, i get next error
Uncaught Error: Call to undefined function mysql_connect() in D:\GDrive\PHP Projects\PHPWebProject1\PHPWebProject1\index.php:2
Stack trace:
#0 {main}
thrown
How could i fix this?