georegjlee Posted March 29, 2007 Share Posted March 29, 2007 This is a sript that runs on a wap phone. It works okay except it inserts a few blank records into the database as well as the one record I want to insert. Any ideas whats wrong. <?php $query = "SELECT t1.waterway_name, t1.waterway_id FROM waterways=t1 WHERE t1.waterway_initals = 'LB'"; $result = mysql_query($query, $dbhandle); if (!$result) { echo 'Could not run query: ' . mysql_error(); exit; } print ("<select name=\"choice\" value=\"1\" title=\"Waterway\">"); while ($line = mysql_fetch_array($result, MYSQL_ASSOC)){ print ("<option value = \"$line[waterway_id]\"> $line[waterway_name] </option>"); } print ("</select>"); print ("<do type = \"Accept\" label = \"Report problem\">"); print ("<go method=\"get\" href = \"#card7\"><postfield name =\"choice\" value=\"$(choice)\" />"); print ("</go>"); print ("</do>"); ?> </p> </card> <card id = "card7" title = "Report"> <p><em>Waterways Reports</em><br/></p> <p> <small> Description: <input name = "description" maxlenght = "12" /> Severity 1-2: <input name = "severity" format = "N" /> Member Id: <input name = "memberid" value = "$username" maxlenght = "12" /> </small> </p> <do type = "Accept" label = ""> <go method="get" href = "#card8"><postfield name ="description" value="$(description)" /><postfield name ="severity" value="$(severity)" /><postfield name ="memberid" value="$(memberid)" /><postfield name ="wwid" value="$(wwid)" /> </go> </do> </card> <card id = "card8" title = "Report"> <?php $desc = "$_GET[description]"; $sev = "$_GET[severity]"; $memid = "$_GET[memberid]"; $ww_id = "$_GET[choice]"; $query = "Insert Into pending_problems (problem_desc, problem_severity, waterway_id, member_id)"; $query .= "Values ('$desc', '$sev', '$ww_id', '$memid')"; $result = mysql_query($query, $dbhandle); //mysql_close($dbhandle); print ("$ww_id"); ?> <p> <em>Problem Added.</em><br /> <a accesskey = "1" href = "ww_select.wml#index" title = "Main Menu">Main Menu</a> </p> </wml> Quote Link to comment https://forums.phpfreaks.com/topic/44804-wml-php/ Share on other sites More sharing options...
MadTechie Posted March 29, 2007 Share Posted March 29, 2007 change the $desc = "$_GET[description]"; $sev = "$_GET[severity]"; $memid = "$_GET[memberid]"; $ww_id = "$_GET[choice]"; to $desc = $_GET['description']; $sev = $_GET['severity']; $memid = $_GET['memberid']; $ww_id = $_GET['choice']; Quote Link to comment https://forums.phpfreaks.com/topic/44804-wml-php/#findComment-217549 Share on other sites More sharing options...
georegjlee Posted March 29, 2007 Author Share Posted March 29, 2007 No that didn't make a difference. Quote Link to comment https://forums.phpfreaks.com/topic/44804-wml-php/#findComment-217655 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.