Help needed with script

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I am quite new to all this and have stumbled at the first gate.

Can anyone tell me what is wrong with this?


$connection =

$sql = 'SELECT * ';
$sql .= 'FROM `PageElements` ';
$sql .= 'WHERE pageid = 1 LIMIT 0, 30';


while ($row = mysql_fetch_row($result)) * error message refers to this
for ($i=0; $i<mysql_num_fields($result); $i++)
echo $row[$i] . " ";

echo "\n";


I am getting the following error message:

Warning: Supplied argument is not a valid MySQL result resource in
/home/nprie/public_html/index2.php on line 26 (i have put an asterisk
next to line 26 above) as above script is a fragment of a php file.


Re: Help needed with script

mysql_select_db('DB_NAME', $connection) between connecting to mysql and
your 1st query


Re: Help needed with script

Many thanks - that solved the problem.


Re: Help needed with script

Have you tried including a


after the call to mysql_connect(...); Its the mistake that I always make.

Derek wrote:
Quoted text here. Click to load it

Site Timeline