Here's My Code:
$conn =mysql_connect ("localhost", "root", "");
if (! $conn)
Die ("Could Not Connect:". Mysql_error ());
if (!mysql_select_db ("User2", $conn))
echo "Failed to connect to database";
mysql_query ("Set names UTF8", $conn);
mysql_query ("CREATE TABLE table1 (
ID int PRIMARY KEY NOT NULL auto_increment,
Name varchar (+) is not NULL,
Email varchar (+) NOT NULL,
Age int ()) ", $conn);
mysql_query ("INSERT INTO table1 (name,email,age)
VALUES (' Sun ', 12345@emial.com,19), $conn);
echo "Hello world!
";
$result =mysql_query ("SELECT * FROM table1", $conn);
while ($row =mysql_fetch_row ($result))
{
/* echo Var_dump ($row). "
";
echo "
";*/
echo "
$row [0]--$row [1]--$row [2];
foreach ($row as $value)
{
echo "-$value";
}
echo "
";
}
echo "Hello";
Mysql_free_result ($result);
Mysql_close ();
?>
Results:
Reply to discussion (solution)
Check if there's any data in the Table1.
The above code is not added, I can not query through the client
The result of my client query is only one database Information_schema but the Data folder has a database created by PHP.
Under the command line, see if the table exists and see if there is data in the table.
Insert INTO table1 (name,email,age)
VALUES (' Sun ', 12345@emial.com,19)
Don't need to use the citation number?
mysql_query ("INSERT INTO table1 (name,email,age)
VALUES (' Sun ', 12345@emial.com,19), $conn);
There is no success in inserting it.
mysql_query ("INSERT INTO table1 (name,email,age)
VALUES (' Sun ', 12345@emial.com,19), $conn);
There is no success in inserting it.
mysql_query ("INSERT INTO table1 (name,email,age)
VALUES (' Sun ', 12345@emial.com,19), $conn) or Die (Mysql_error ());
Under the command line, see if the table exists and see if there is data in the table.
Why are the two shows different (and don't know if you can see this reply)
Without creating a database, look with the navicate MySQL software.
Without creating a database, look with the navicate MySQL software.
The problem is solved, I want to ask the question of the 9 floor can solve?
What user are you logged in with?
What user are you logged in with?
This is not landing ah is in MySQL bin folder under a mysql.exe and then show databases out of
You are logged in to MySQL with the current Windows user, so you only see the database you can see.
Run: Mysql.exe with--user=root--password= ... You can see all the databases.
Thank you so much!
You are logged in to MySQL with the current Windows user, so you only see the database you can see.
Run: Mysql.exe with--user=root--password= ... You can see all the databases.