Jump to content

Probably very simple answer. I hope!


stig1

Recommended Posts

I have a table filled with data that I get returned from MySQL using the mysql_fetch_array() function.

 

Within the table rows, I have an input box that I would like to set each value different.

 

Eg. $qty[0], $qty[1], $qty[2].

 

And so on, until it reaches the end of the data range set.

 

Is this possible? Simple? Any help most apprecaited.

Link to comment
https://forums.phpfreaks.com/topic/126712-probably-very-simple-answer-i-hope/
Share on other sites

<?php $res=array("cat","dog","pig"); ?>

<form method="POST" action="<?php echo $_SERVER['PHP_SELF'] ?>" ">

<br>

<?php foreach( $res as $r){

$replace=array("cat","pig",$r);

$replace_with=array("mice","tigger",$r);

$r=str_replace($replace,$replace_with,$r);
?>

<input type="test" name="<?php echo $r; ?>" value="<?php echo $r;?>" >

<?php } ?>

<br>

<input type="submit" name="submit" value="SEND!">

</form>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.