justinh Posted February 9, 2009 Share Posted February 9, 2009 <?php for($i = 1; $i <= $_POST['numberinparty']; ++$i){ $fname = $_POST[$i .'fname']; $lname = $_POST[$i .'lname']; $sql = "INSERT INTO hrclienta ( cl_id, cl_firstname, cl_lastname, cl_address, cl_city, cl_zip, cl_state, cl_email, cl_cell, cl_home, cl_fax, cl_partyid, cl_under, cl_hunter, cl_partycontact) VALUES('', '$fname', '$lname', '', '', '', '', '', '', '', '', '$_SESSION[huntid]', '', '', '')"; $queryadd = mysql_query($sql) or die(mysql_error()); echo "<label><b>Guest ".$i.":</b></label>".$fname." ". $lname."<br /><br>"; } ?> This is adding a blank row into the database after it adds all the clients. Any ideas? If I need to post the whole code I can. Link to comment https://forums.phpfreaks.com/topic/144492-loopquery-problem/ Share on other sites More sharing options...
premiso Posted February 9, 2009 Share Posted February 9, 2009 for($i = 1; $i < $_POST['numberinparty']; ++$i){ Try that for the for statement, and see what happens. Link to comment https://forums.phpfreaks.com/topic/144492-loopquery-problem/#findComment-758201 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.