Page is a not externally linkable
The_Hat - 3:21 pm on Apr 29, 2010 (gmt 0)
I need to dynamically specify the name of the row in my database I want to pull out..
For instance, here is what I am wanting to do..
## $targetTable: this variable changes
## $primary: this variable changes
## $primaryValue: this changes
## $rowName: this changes
$result = mysql_query("SELECT * FROM ".$targetTable." WHERE ".$primary." LIKE '".$primaryValue."'");
while($row = mysql_fetch_array($result)) {
$want = $row['$rowName'];
echo $want ;
}
All the variables get stated higher up in the code but I don't seem able to specify dynamically what the name of the row is I want the data from.. I'm sure it's just syntax, i.e. doubleQuote-period-quote.. something or other.. but I sure can't suss it out..
Any help guys?