View Full Version : vb gallery
sweet22
Mon 3rd Nov '03, 10:34am
ok im making a gallery for my vb and i was wondering how i would make multiple pages/galleries out of one php file. like vb with displaying multiple forums from one php file.
sweet22
Mon 3rd Nov '03, 1:01pm
ok im using a if($id==1) but i want to make it so that it retrives the id from mysql or sumthing like vb does for forum id. also how would i retrieve certain values from mysql and not a whole field of values?
Matty Bwoy
Tue 4th Nov '03, 3:30am
select fields from table where id='$id'
That'll only select rows from the database where the field 'id' has the value that is given to the file.
sweet22
Tue 4th Nov '03, 12:37pm
so is this how it should be?
if(id==$id){
msql_query("SELECT * FROM gallery WHERE id='$id'");
}
Matty Bwoy
Tue 4th Nov '03, 12:42pm
No, you won't need the if statement.
Say you want to get the gallery that is number 1.
And you'd open the page by using gallery.php?id=1
Your code would be:
mysql_query("SELECT * FROM gallery WHERE id='".$id."'");
I type id='".$id."', although there are other ways to do it, just my style.
Hope this helps.
vBulletin® v3.8.0 Release Candidate 1, Copyright ©2000-2008, Jelsoft Enterprises Ltd.