Split mysql results into pages?????

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

Illusionist
Forum Regular
Posts: 903
Joined: Mon Jan 12, 2004 9:32 pm

Post by Illusionist »

hmm...
1) are you sure there is an ID field in your database?
2) after setting $query, echo it back out and make sure it is ok
3) i dunno...
mikegotnaild
Forum Contributor
Posts: 173
Joined: Sat Feb 14, 2004 5:59 pm

Post by mikegotnaild »

Im positive there is an ID field.
Illusionist
Forum Regular
Posts: 903
Joined: Mon Jan 12, 2004 9:32 pm

Post by Illusionist »

did you try the second suggestion??
mikegotnaild
Forum Contributor
Posts: 173
Joined: Sat Feb 14, 2004 5:59 pm

Post by mikegotnaild »

you mean echo "Query: $query"; ? I did that and this is the output

"Query: SELECT * FROM Acoustic WHERE ID=
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /www/n/naild/htdocs/localmm/modules/Bands_Showcase/page2.php on line 18"
Illusionist
Forum Regular
Posts: 903
Joined: Mon Jan 12, 2004 9:32 pm

Post by Illusionist »

ahh OK! so our SELECT statement is wrong... Are you just viewing this page normally from a browser, or are you clicking on taht link that actually tells waht the band ID is?
mikegotnaild
Forum Contributor
Posts: 173
Joined: Sat Feb 14, 2004 5:59 pm

Post by mikegotnaild »

go here. http://naild.com/localmm Click on Bands showcase than go to Acoustic.. Thats the page im lookin at. Its acoustic.php. Its the first page. Ok in the select statement i put ' ' around like this . SELECT * FROM Acoustic WHERE ID='$id'"; and the error went away. but there isnt no query results.. just my $query echo But when i echo the $query it shows this "Query: SELECT * FROM Acoustic WHERE ID='' " $id isnt putting out anything. I have a question though.. what is 'band' in this $id = $_GET['band'];? I am very lost now.
Illusionist
Forum Regular
Posts: 903
Joined: Mon Jan 12, 2004 9:32 pm

Post by Illusionist »

OK, well i went there but the links to get ot the individual pages are missing. And band there is how you were passing the ID through the URL.... something.php?band=$id
Post Reply