Php & Db Problim

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
doggy
Forum Commoner
Posts: 80
Joined: Tue Dec 09, 2003 5:01 am
Location: South Africa

Php & Db Problim

Post by doggy »

Code: Select all

<?php
include("themes/default/theme.php");
include("mainfile.php");

$DB = new DB;                                                                                                                                    
$address = $HTTP_GET_VARS['address'];                                                                                                                                                         
$DB->sql = "SELECT * FROM address WHERE adress = '1000000000000001'";                                                                                                  
$DB->result = mysql_query($DB->sql);                                                                                               
$DB->row = mysql_fetch_array($DB->result);
$title = $DB->row[title];

themeheader('$title', "Theme Header");
themeblockl("Block Left");
themecontent("Content");
themeblockr("Block Right");
themefooter("FOOT FOOT");
?>
I get this error

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\FoxServ\www\atlas_n\index.php on line 10

and line 10 is

$DB->row = mysql_fetch_array($DB->result);

PLease could some one help me out. Thanks
Post Reply