Hello, I'm having difficulty dynamically creating a variable name for
mysql_query.
I've tried using variable variables. I tried to re-create the sql string by
$a = "update table set startdate='$startdate"
$a .= $i ." ' where id=$i");
but that didn't work.
I'm dynamically creating each name of the input tag.

My input tag is:  name=startdate<?echo id ?>

but when I use

$query = mysql_query("select * from table");
$num_rows = mysql_num_rows($query);
for($i=1;$i<=$num_rows;$i++){
$updatesql = mysql_query("update table set startdate='$startdate.=$i' where
id=$i");
}

It doesn't execute.
Can someone tell me what I'm doing wrong. Any help would be greatly
appreciated.

Thanks
Cory

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to