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;
?>

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.

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

------------------------------------------------------------------------------------------------------------
Wampserver 3.2.3 32 bit - Apache 2.4.46 - PHP 7.4.9…5.6.40 - MySQL 5.7.31 - MariaDB 10.5.5
Wampserver 3.2.3 64 bit - Apache 2.4.46 - PHP 7.4.9…5.6.40 - MySQL 5.7.31/8.0.21 - MariaDB 10.5.5
PhPMyadmin 5.0.2 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Sorry, only registered users may post in this forum.