| Andy Hassall 2006-10-30, 7:03 pm |
| On Sun, 29 Oct 2006 10:58:35 +0000, Bill <bill@tiscali.co.uk> wrote:
>Can anyone help. I am trying to build a website using php and css. The
>plan was to put all the data into a database and extract it and place
>into areas of the webpage.
>Used the following code
>
>$sql = "select text from mainpage where mainpageID = 1";
>$header = @mysql_query($sql,$connection) or die("cant querry");
>
>then on the webpage where I wanted the text I put
><?php
> echo "$header";
>?>
>Received the message Resource id #5 instead of text.
>Is there something I have forgot to do. Or what am I doing wrong.
Read through the example 2 in the manual, which shows all the steps you need
to go through including the missing final step to fetch the data:
http://uk.php.net/mysql_query
--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
|