2
Good,
Looking at this query:
$sql = mysql_query("select A, B, C, D from table");
$row_sql = mysql_fetch_assoc($sql);
I want to take the A column and put all the values in an array:
$var = array('value1','value2','value3','value4');
What’s the best way to do it?
Thank you.
Thank you for the reply, and it worked, but the first value does not appear. Assuming the result would be: value1, value2, Valor3, etc...
– user26858
You are repeating the
mysql_fetch_assoc($sql)
is not ?– Diego Souza
No, it is unique in code. <? php $sql = mysql_query("select A from Tablea Where B IN($Var)"); while($res = mysql_fetch_assoc($sql)){ $arrData[] = $res['A']; } #echo '<pre>'; print_r(implode(',',$arrData)); #echo '</pre>' ;?>
– user26858
Update your post with the current code and with the return of the code.
– Diego Souza
I redid the code and everything worked fine. There must have been something I couldn’t find to impact the result. Thank you.
– user26858