I understand the usage of <? ?> ... I was simply copying what had appeared in the following post ...
Author: Dominik Nufer (195.65.87.136) Profile
Date: 2001-03-07 04:14:14
You can catch this exception with a if()
if ($row = mysql_fetch_array($result)) {
do {
?><?=$row["text"]?><?
} while($row = mysql_fetch_array($result));
} else {}
.. it didnt make sense to me, but then I'm relatively new to this, and thought I would submit myself to someone who was a bit more experienced ...
Unfortunately I became VERY confused when this same post (listed out of thread context) reads as follows ...
Author: Dominik Nufer
Date: 2001-03-07 04:14:14
Subject: RE: Warning: 0 is not a Mysql result index
You can catch this exception with a if()
if ($row = mysql_fetch_array($result)) {
do {
?> } while($row = mysql_fetch_array($result));
} else {}
Now, I have tried both these solutions, trying to tailor them to my situation, but am not having any luck.
My code reads as follows:
8# verify user from admin_login.htm
9
10$sql = "SELECT * FROM admin_login WHERE (username=$admin_user && password=$admin_pass)";
11
12# Execute the query and put results in $result
13
14 if($result = mysql_query($sql)) {
15 do { ?> <? =$result("text") ?> <? }
16 while $result = mysql_query($sql));
}
I get a parse error on line 15.
Before this, I also have a require file, which I have checked and double checked for errors ... but the ?><? on line 15 worries me... can someone clarify this please.