PHP help

Posted by KaBob799 on June 1, 2006, 7:59 p.m.

I need to do a query that searches a certain field for a value, and the value it is searching for would be in the url (the index.php?value=blah type thing)

and when it finds one it displays a single value from that row (not the same value it was searching for)

but no matter what I try cant get it to display it.

So if anyone here knows how I would appreciate being shown.

oh and I made a new screensaver called spotlight, you can download it from my site

http://www.tz-c.com/Downloads

Comments

KaBob799 18 years, 6 months ago

i need the whole code, not just the getting variable part.

and im using PHP version 4.3.11

flashback 18 years, 6 months ago

Yeesh, lazy. Easiest thing to do in the world (aside from eating pie).

[<]?php
$searchvar=$_GET['value'];
$query = mysql_query("SELECT * FROM table WHERE column=$searchvar ORDER BY id DESC LIMIT 1");
while($row = mysql_fetch_array($query))
{
print $row['columnyouwantthedataof'];
}
?[>]

takua108 18 years, 6 months ago

Eating pie can be difficult under certain circumstances…