switch3133
Programmer
Hi,
This is my first post in this forum, i'll try to be descriptive.
I'm trying to use PHP to display the MySQL databases and then I ask for the SQL command to be performed on the database. It's very basic, I know
Here's my code :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="expires" CONTENT="0">
</HEAD>
<BODY BGCOLOR = "#FFFFFF" LINK="#000080" VLINK="#000080" ALINK="#0000FF">
<?php
error_reporting(E_ALL);
$host="localhost";
$user="olympic_sql";
$password="(REMOVED!FOR.THE.FORUM)";
?>
<FORM NAME="requete_sql" ACTION="exemple_mysql_test.php" METHOD=POST>
Sélectionnez la base de donnée SQL pour la requête :<BR><BR>
<SELECT NAME="database" SIZE=1>
<?php
mysql_connect($host, $user, $password);
$db_table = mysql_list_dbs();
for ($i = 0; $i < mysql_num_rows($db_table); $i++)
{
echo ("<OPTION>" . mysql_tablename($db_table, $i);
}
?>
</SELECT>
<BR><BR>
Entrez la requête à exécuter :
<BR><BR>
<TEXTAREA NAME"req" COLS=50 ROWS=10></TEXTAREA>
<BR><BR>
<INPUT TYPE="SUBMIT" VALUE="Envoyer" NAME="Envoyer">
</FORM>
</BODY>
</HTML>
Then I save it and send it on my webhosting ftp.
Here's the configuration of the server :
apache 1.3.33 (Unix)
mysql 4.0.22-standard-log
Linux OS Kernel 2.4.20-28.7
PHP 4.3.9
BUT NOTHING DISPLAYS when I hit reload.
AND if I view the source of the page I can see the following HTML code :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD>
<BODY></BODY></HTML>
(???) I just don't get it. Please help. I have looked in
the php manual :
My first feeling is that the server cannot go back from php to html.
Best regards,
Frederick St-Hilaire
This is my first post in this forum, i'll try to be descriptive.
I'm trying to use PHP to display the MySQL databases and then I ask for the SQL command to be performed on the database. It's very basic, I know
Here's my code :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="expires" CONTENT="0">
</HEAD>
<BODY BGCOLOR = "#FFFFFF" LINK="#000080" VLINK="#000080" ALINK="#0000FF">
<?php
error_reporting(E_ALL);
$host="localhost";
$user="olympic_sql";
$password="(REMOVED!FOR.THE.FORUM)";
?>
<FORM NAME="requete_sql" ACTION="exemple_mysql_test.php" METHOD=POST>
Sélectionnez la base de donnée SQL pour la requête :<BR><BR>
<SELECT NAME="database" SIZE=1>
<?php
mysql_connect($host, $user, $password);
$db_table = mysql_list_dbs();
for ($i = 0; $i < mysql_num_rows($db_table); $i++)
{
echo ("<OPTION>" . mysql_tablename($db_table, $i);
}
?>
</SELECT>
<BR><BR>
Entrez la requête à exécuter :
<BR><BR>
<TEXTAREA NAME"req" COLS=50 ROWS=10></TEXTAREA>
<BR><BR>
<INPUT TYPE="SUBMIT" VALUE="Envoyer" NAME="Envoyer">
</FORM>
</BODY>
</HTML>
Then I save it and send it on my webhosting ftp.
Here's the configuration of the server :
apache 1.3.33 (Unix)
mysql 4.0.22-standard-log
Linux OS Kernel 2.4.20-28.7
PHP 4.3.9
BUT NOTHING DISPLAYS when I hit reload.
AND if I view the source of the page I can see the following HTML code :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD>
<BODY></BODY></HTML>
(???) I just don't get it. Please help. I have looked in
the php manual :
My first feeling is that the server cannot go back from php to html.
Best regards,
Frederick St-Hilaire