Jump to content

Archived

This topic is now archived and is closed to further replies.

corillo181

mysql and php display..

Recommended Posts

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..

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.