help with very simple php problem...
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

help with very simple php problem...

From: max <nospam@nospam.com>
Date: Sat Jul 16 2005 - 13:01:53 CEST

Hi, I've just started learning some stuff about php and have been
following a couple of tutorials. At the moment I'm stuck with this small
piece of code which gives me an error "mysql_fetch_array():supplied
argument is not a valid MySql result"

<?php
include 'config.php';
include 'opendb.php';

$query="SELECT cname, csubject, cmessage FROM contact";
$result=mysql_query($query);

while($row= mysql_fetch_array($result,MYSQL_ASSOC))
        {
                echo
                        "Name :{$row['cname']} <br>" . "Subject : {$row['csubject']} <br>" .
"Message : {$row['cmessage']} <br><br>";
        }
include 'closedb.php';
?>

This should just display the content of a table..
Thanx for your help!
Received on Mon Oct 17 21:08:30 2005