Hiya
I'm trying to make a basic events listing for my disertation/a website i run and have so far managed to get the form to write to the database, however when it comes to pulling off the records from the database I get the following error:
Fatal error: Call to a member function on a non-object in /home/*/*/gigs.php on line 21
Here's the code I'm using to connect, I know it connects because the files are on the database, its just pulling them off thats casuing the problem.
its an edited version of a script i was using to pull off events from a VB database, but I need to get it working on its own without VB for my dissertation.
Any guidence would be hugely appreciated!
Seanie!
I'm trying to make a basic events listing for my disertation/a website i run and have so far managed to get the form to write to the database, however when it comes to pulling off the records from the database I get the following error:
Fatal error: Call to a member function on a non-object in /home/*/*/gigs.php on line 21
Here's the code I'm using to connect, I know it connects because the files are on the database, its just pulling them off thats casuing the problem.
Code:
#################################################################### ################ DATABASE CONFIGURE ############################## #################################################################### $hostname = "localhost"; $db_user = "username"; $db_password = "seanie"; $db_name ="database"; $db_table = "gigs"; # STOP HERE #################################################################### # THIS CODE IS USED TO CONNECT TO THE MYSQL DATABASE $db = mysql_connect($hostname, $db_user, $db_password) or die ('Error connecting to mysql'); mysql_select_db($db_name); $timecutoff = mktime(0,0,0); $events = $db->query("SELECT * FROM `gigs` WHERE `gig_date` > $timecutoff ORDER BY `gig_date` ASC LIMIT 25"); //THIS IS LINE 21
its an edited version of a script i was using to pull off events from a VB database, but I need to get it working on its own without VB for my dissertation.
Any guidence would be hugely appreciated!
Seanie!
Comment