probably newbie error with mysql
Posted by: Error0x4c (---.virtua.com.br)
Date: July 31, 2020 10:45PM

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>"winking smiley;
$db = new mysqli("localhost","root","","classicmodels"winking smiley;
if($db){
$res = $db->query("SELECT * FROM customers WHERE country = 'USA';"winking smiley;
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>"winking smiley;
?>

Options: ReplyQuote
Re: probably newbie error with mysql
Posted by: Error0x4c (---.virtua.com.br)
Date: July 31, 2020 11:02PM

i solved the problem disabling mariadb and restoring port of mysql to 3306.

Options: ReplyQuote
Re: probably newbie error with mysql
Posted by: Otomatic (Moderator)
Date: August 01, 2020 10:08AM

Hi,

Why didn't you read the recommended documentation when installing Wampserver?

Repeated with : Right-Click -> Help -> MariaDB - MySQL

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote


Sorry, only registered users may post in this forum.