Pig thank you for your responce, but I know that and I think you are missing the point of what i am trying to accomplish..
Perhaps my code is so far off that you couldnt.
The goal is: for each $row[domain] to assign a number as the input name.....
So if you have domains: abc.com 123.com xyz.com
The input names would be: domain1 domain2 domain3
print "<input type=\"text\" name=\"domain$i\" value=\"$val\">\n";
Which Kinda Works.... BUT it Currently Prints as Follows:
<input type="text" name="domain1" value="abc.com">
<input type="text" name="domain2" value="abc.com">
<input type="text" name="domain3" value="abc.com">
<input type="text" name="domain1" value="123.com">
<input type="text" name="domain2" value="123.com">
<input type="text" name="domain3" value="123.com">
<input type="text" name="domain1" value="xyz.com">
<input type="text" name="domain2" value="xyz.com">
<input type="text" name="domain3" value="xyz.com">
This is actually just a portion of what the total Code is to do. I thought if I could get this far I could get the rest..
I am actually selecting the domains from multiple rows of one table into my form and then will be inserting them and other values into a single row of another table..
Perhaps this is not the right way to even do it... Perhaps I shouldnt even use a form ?? I would Rather not even use a form.
I would rather it be something like (Simplified as I Dont know):
<?php
include('config.php');
$now = date("m\/j\/Y");
$query = "SELECT domain FROM account WHERE clientid = '$clientid' and type !='domain'";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result)) {
foreach ($row as $val){
for ($i=0;$i < mysql_num_rows($result);$i++){
}
}
$query2 = "INSERT INTO invoice (clientid, invoicedate, domain1, domain2, domain3, fee1, fee2, fee3 ) VALUES ('$clientid', '$now', '$val1, '$val2, '$val3, '$row[fee]1', '$row[fee]2', '$row[fee]3')";
$result6 = mysql_query($query6);
if ($result6) {
print "It Worked\n";
} else {
print "Error\n";
echo mysql_error();
}
}
?>
I Know the above (Values() is not correct just trying to show what I want to do. I dont know how to get the single row[domain] and row[fee] from query1 to go into the fields of query2 as domain1, domain2, domain3, fee1, fee2, fee3, etc, etc.... for the values( )...
Any Additional help is Greatly appreciated....