PHP MYSQL Access all columns in the same field using an array using FOR loop -


clear , direct question here. have loop using access data in array. know if more 1 column exists in same field, last 1 takes precedence. how 1 access data in columns same field? here loop

for($counter=0;$counter<$found;$counter++) 

{

$cellphonenumber=$details['cellphone_number']; $childname=$details['child_first_name'];     $parentname=$details['first_name']; $msg="dear $parentname, child $childname due shots"; 

i have hundreds of records , need access each 1 of them , send msg. using mysql_fetch_assoc. heard can use numeric index of columns. how do that?

your question not clear, code should this:

$sql = "select email, cellphone_number, child_first_name, first_name table"; $result = mysql_query($sql);  while ($row = mysql_fetch_assoc($result)) {      $cellphonenumber = $row['cellphone_number'];     $childname = $row['child_first_name'];     $parentname = $row['first_name'];      $msg="dear $parentname, child $childname due shots";      mail($row['email'], "important subject", $msg, "from: me@example.com");  } 

Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -