Quantcast
Channel: WampServer - WampServer English
Viewing all articles
Browse latest Browse all 3177

probably newbie error with mysql (2 replies)

$
0
0
win version 10 64bits
wampserver latest 64bits
icon green
i have accesss to phpmyadmin and wampserver home

hello, ive been using wampserver. i installed and uninstalled a couple times before following the recomendations and it was all working. now mysql doesnt want to work with php ( it works on terminal mysql )

here is the error:
Unknown database 'classicmodels' in C:\wamp64\www\test\db.php on line 3
Call Stack

im sure that database is in present. sometimes it doesnt recognize object mysqli
MySql is using port 3308, i dont know why.

heres the php file:
<?php
print("<html><body>");
$db = new mysqli("localhost","root","","classicmodels");
if($db){
$res = $db->query("SELECT * FROM customers WHERE country = 'USA';");
if($res){
print($res->num_rows);
echo '</br></hr><pre>';
foreach($res as $val)
print_r($val);
echo '</pre>';
}
else
print 'failed query';
}
else
print 'could not open db';
print("</body></html>");
?>

Viewing all articles
Browse latest Browse all 3177

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>