Hi,
I just installed MySQL and PHP on Windows XP and have a question. I created
a test database on Windows (exactly the same as the test one I use in Linux)
and copied a test PHP script which accesses Mysql and displays some
information. On Linux it works perfectly, but on Windows I get the following
error. Are there different commands or syntax on the two different
platforms?
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result
resource in e:\directory\index.php on line 21.
This is the exact code below:
<?
PRINT "<HTML>";
PRINT "<HEAD>";
PRINT "<TITLE>ADDRESSES</title>";
PRINT "</HEAD>";
PRINT "<BODY BGCOLOR=white TEXT=#000000 LINK=#FF0000 VLINK=#000066
aLINK=#FF0000>";
$out[]=0; // I also got an error about this - without it here I get an
undefined variable error below....
mysql_connect("localhost:3308", "user", "password") or
die("could not connect");
mysql_select_db("address");
$query = "SELECT * FROM data";
$result = mysql_query ($query);
while ($line = mysql_fetch_row($result)) {
$out[]=$i;
}
?>
<form action="<? echo $PHP_SELF; ?>" method="post">
<P><TABLE WIDTH="400" BORDER="0">
<TR><TD ALIGN="left">Name :</TD><TD ALIGN="left"><INPUT TYPE="text"
NAME="lastname" SIZE="20" VALUE="<? echo
$out[0][1]?>"></TD></TR>
<TR><TD ALIGN="left">Name :</TD><TD ALIGN="left"><INPUT TYPE="text"
NAME="lastname" SIZE="20" VALUE="<? echo
$out[0][2]?>"></TD></TR>
<TR><TD ALIGN="left">City:</TD><TD ALIGN="left"><INPUT TYPE="text"
NAME="city" SIZE="20" VALUE="<? echo
$out[0][3] ?>"></TD></TR>
</TABLE>
</FORM>
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php