Hi,
I have fields named thus:
field_1, field_2, field_3 etc.
Is it possible to reference them in a loop like this?
$i=1;
while($row=mysql_fetch_array($result)){
$sql = "UPDATE tablename SET field_".$i." = '".$value."' ";
}
or perhaps like this?
$sql = "UPDATE tablename SET field_$i = '".$value."' ";
Also, if a sql query returns no records, is it correct to use this
sql = "SELECT * FROM table WHERE records = 1";
$result = mysql_query($sql);
if($result>0){
//etc etc
}
Thanks,
Mei