corillo181 Posted May 6, 2006 Share Posted May 6, 2006 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.. Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted May 6, 2006 Share Posted May 6, 2006 Use the select all operator in your sql query like so:[code]$sql2="SELECT * FROM guestbook WHERE name='$getpic'";[/code]The * means select all fields in the table Quote Link to comment Share on other sites More sharing options...
corillo181 Posted May 6, 2006 Author Share Posted May 6, 2006 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 databaseso this wwont work select * from table where name=$name AND username Quote Link to comment Share on other sites More sharing options...
corillo181 Posted May 6, 2006 Author Share Posted May 6, 2006 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.