Page 1 of 1
$_GET Variable Question
Posted: Sun Feb 06, 2005 4:05 pm
by Stelios
Hi there, I've got a question that is been bothering me for very long.
I have got a table on my database which contains a field called 'bpm'. On the script am creating I want to be able to retrieve the value of this 'bpm' so that I include it to my query such as...
Code: Select all
$bpm=$_GETї'BPM'];
$query5 = "SELECT * FROM uploads WHERE mood = {$_GETї'mid']} AND BPM = '$bpm'";
Apparently I cant do this because am getting a message saying 'Undefined index : BPM'...Any ideas on that?

Posted: Sun Feb 06, 2005 4:28 pm
by John Cartwright
EDIT: sorry, misunderstood question
Posted: Sun Feb 06, 2005 4:41 pm
by Stelios
Am afraid it doesnt work...ok...let me put it in another way.
Ive got this script:
Code: Select all
<a href="similar.php?mid={$rowї'mood']}">BLABLA</a>
What I want to do is to get the values of 2 fields in order to proceed to the next link. How can I put a second row on the same line? I tried this but it doesn't work...
Code: Select all
<a href="similar.php?mid={$rowї'mood']} && {$rowї'BPM']}">
Posted: Sun Feb 06, 2005 5:03 pm
by djot
-
Hi,
Code: Select all
<a href="similar.php?mid={$rowї'mood']}&{$rowї'BPM']}">
This is how to pass multiple values via GET.
foo.php?var1=value1&var2=value2
$query5 = "SELECT * FROM uploads WHERE mood = {$_GET['mid']} AND BPM = '$bpm'";
Put quotes around the user submitted input. Before, check if the user input is valid (and not some db-hacking code).
(Is the db field named 'bpm' or 'BPM'?)Code: Select all
$query5 = "SELECT * FROM uploads WHERE mood='{$_GETї'mid']}' AND bpm='$bpm'";
djot
-
Posted: Sun Feb 06, 2005 5:13 pm
by Stelios
It is BPM
Posted: Sun Feb 06, 2005 5:18 pm
by Stelios
THANKS A LOT!!!IT WORKED JUST FINE!!!
