Current location: Hot Scripts Forums » Programming Languages » PHP » a very simple album, help needed.


a very simple album, help needed.

Reply
  #1 (permalink)  
Old 10-30-06, 01:27 PM
itssami itssami is offline
Newbie Coder
 
Join Date: Apr 2006
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
a very simple album, help needed.

Hey, I created a page album.php, it shows all the images of a user xxx. and its url is like album.php?nick=xxx. Now suppose there are 2 images in this user album, one image id is 111 and second image id is 112.now how i can link to the each image of the album so that it looks like , album.php?nick=xxx&image_id=111. and album.php?nick=xxx&image_id=112.
I hope you understand it.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 10-30-06, 01:30 PM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,074
Thanks: 11
Thanked 88 Times in 83 Posts
You will have to post your code.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 10-30-06, 01:50 PM
itssami itssami is offline
Newbie Coder
 
Join Date: Apr 2006
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
okay its here..please have a look.
PHP Code:

<?

ob_start
();
include(
"config.php");
if (!
$_GET[nick])
{
$getuser mysql_query("SELECT * from users order by id asc");
while (
$user mysql_fetch_array($getuser))
{

echo (
"<a href=\"album1.php?nick=$user[username]\">$user[username]</a><br />\n");

}
}
ELSE
{
$getuser mysql_query("SELECT * from pictures where username = '$_GET[nick]'");
$usernum mysql_num_rows($getuser);
if (
$usernum == 0)
{
echo (
"User Not Found");
}

else
{
while (
$row mysql_fetch_array($getuser)) { 
echo 
"<a href='funnypics/$row[link]' target='_blank'><img src=funnypics/$row[link] width='200px'></a><br>";

}
}
}
?>

Last edited by Nico; 10-30-06 at 01:54 PM. Reason: Please use [php] wrappers when posting PHP code.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 10-30-06, 02:39 PM
gorivo's Avatar
gorivo gorivo is offline
Newbie Coder
 
Join Date: Mar 2006
Location: Lithuania
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Question

What are the fields of mysql tables `users` and `pictures` ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 10-30-06, 02:57 PM
itssami itssami is offline
Newbie Coder
 
Join Date: Apr 2006
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
i was just testing thats why i just created 2 tables, it can be done by only one table , users and in users i made the columns the user id, password, email, and image_id, etc. i hope you understand this.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple db_ help needed aclips PHP 0 03-24-06 06:52 PM
Simple PHP Search Script needed sohaib PHP 2 01-01-06 01:38 PM
Simple Mod for Game Needed HopesDespair Job Offers & Assistance 0 07-21-05 09:50 PM
Flash Album needed! asiankomodo Script Requests 1 06-12-05 10:43 AM
Simple Script NEEDED ASAP - $$$$ legante Script Requests 0 11-01-04 04:18 PM


All times are GMT -5. The time now is 06:57 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.