PDA

View Full Version : gallery project need some help


sweet22
11-03-2003, 12:20 PM
ok im doing good so far with my gallery for vb but i need help with creating multiple galleries from just one php page. kinda like vb with displaying multiple forums but only using one php file.

Dean C
11-03-2003, 03:24 PM
Are you offering to pay? If not then it should be in "Help Me Finish" forum. If so it should be in "Service Requests" forum. Let me know and i'll move it to the appropriate forum for you :)

sweet22
11-03-2003, 03:37 PM
im not paying, lol i was just wondering how i would use if($id==1){
stuff like vb does but im confused, so move it to help me finish forum(even though im not close to finishing)

also how would i retrieve certain values from mysql without getting all the values from a field

Dean C
11-04-2003, 12:38 PM
What you have is something like this

A url like gallery.php?id=1

Then the php would be something like this:


if(isset($id))
{
intval($id);
$query = $DB_site->query("SELECT * FROM gallery WHERE id=$id");

while($iteminfo = $DB_site->fetch_array($query))
{
// call your templates and stuff here
}
}

sweet22
11-04-2003, 02:04 PM
hmmm im confused how that works, cause im not using the vb way of connecting. should i use that way? cause im putting this gallery on another dbase so it doesnt slow down my vb.

Dean C
11-04-2003, 02:25 PM
if you're looking for vb intigration you're best coding it to vBulletin style standards :) Using the built in database class is nice and easy :)

sweet22
11-04-2003, 02:31 PM
heres wut ive done so far:

$connection= mysql_connect("$server","$dbuser","$userpass") or die("Connection to Data Base not successful,please try again.");
//* for $db type in the name of the database your going to be using
$db="anima823_gallery";
//*do not edit mysql_select_db
mysql_select_db("$db");
//*total views do not edit!//////////////////////////////////////////
$galleryviews= mysql_query("SELECT gal_views FROM gallery_index");
$vrow= mysql_fetch_assoc($galleryviews);
$views=$vrow[gal_views];
$tviews=++$views;
//*views update do not edit!///
//mysql_query("UPDATE gallery_index SET gal_views='$tviews'");
/////////////////////////////////////////////////////////////

//$grab_id= mysql_query("SELECT gal_id FROM gallery_idex");
//$id= mysql_fetch_object($grab_id)
if($id==1){
print "hi";
mysql_query("UPDATE gallery_index SET gal_views='$tviews' WHERE gal_name='test'");
}
if($id==2){
print "hi_#2";
mysql_query("UPDATE gallery_index SET gal_views='$tviews' WHERE gal_name='Character/Character Design'");
}
?>
so far ive made it so that each time you visit a specific gallery it will update the # of views for the gallery.