Jump to content


Photo

mysql and php display..


  • Please log in to reply
3 replies to this topic

#1 corillo181

corillo181
  • Members
  • PipPipPip
  • Advanced Member
  • 896 posts

Posted 06 May 2006 - 09:23 AM

ok.. i havent got this one ..

what i'm trying to do is..

i got 2 data base.. one for pictures and another one for comments..

in php i got the method get so when a person click on a picture the get method searchs for the comment correspoding tot he picture and it display the comment..

i got this working what i can't get working are the fallowing..

in the comment sections i got a username field that when the user levaes a comment it uploads the user name to that field..

this si wroking but i can't get th username to display in php..

neight can i get the time that the user post the comment to be display.. i tried this but it didn't worked..

$sql2="SELECT FROM guestbook WHERE name='$getpic'";
well thats about it :-D i don't know how to get the other 2 rows username and time.. becaus ei'm using the get mothed for the current pic..

and if i try thr picname,username,date from guessbook..

it display all the picname and usenrmae..

so you get the drift..

has to be with the getmother so is only for the current picture..

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 06 May 2006 - 11:02 AM

Use the select all operator in your sql query like so:
$sql2="SELECT * FROM guestbook WHERE name='$getpic'";
The * means select all fields in the table

#3 corillo181

corillo181
  • Members
  • PipPipPip
  • Advanced Member
  • 896 posts

Posted 06 May 2006 - 05:20 PM

i know.. select all but after i put that i have to put a variable that makes up for what i'm looking for and i don't want to make up a variable i simply want to get a value from the database

so this wwont work select * from table where name=$name AND username

#4 corillo181

corillo181
  • Members
  • PipPipPip
  • Advanced Member
  • 896 posts

Posted 06 May 2006 - 06:23 PM

oh forge tit i get what you mean i was trying it like that the problem was i was writing it wrong..was forgetting the varriable array




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users