You have 1 too many commas.  Remove the comma before the from clause in your
sql statement.

----- Original Message -----
From: "Vladimir Kravtsov" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 11, 2001 11:18
Subject: PHP Prob contd.


Well I fixed that part so now the file looks like this:
<html>
<head>
<body>
<?php require('../common.php');
connectdb();
mysql_select_db(xtopsites);
$validated=1;
$sql = "select id, siteurl, sitename, from sitesats where validated =
'$validated'";

$r = mysql_query($sql);
$numrows = mysql_num_rows($r);
echo (mysql_error());
$row = mysql_fetch_array($r);
echo (mysql_error());
?>
</body>
</html>

Now, when I run it I get this error:
Warning: Supplied argument is not a valid MySQL result resource in
c:\inetpub\wwwroot/php/X-TopSites/admin/admin.php on line 11
You have an error in your SQL syntax near 'from sitesats where validated =
'1'' at line 1
Warning: Supplied argument is not a valid MySQL result resource in
c:\inetpub\wwwroot/php/X-TopSites/admin/admin.php on line 13
You have an error in your SQL syntax near 'from sitesats where validated =
'1'' at line 1

What could be wrong now?



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

Reply via email to