djbuddhi Posted February 29, 2008 Share Posted February 29, 2008 When typing “+65 6225 0428” as the far fax number filed when submit data to my sql in the php page it gives an eeror in the php code . How to prevent the above error Link to comment https://forums.phpfreaks.com/topic/93670-help/ Share on other sites More sharing options...
mmarif4u Posted February 29, 2008 Share Posted February 29, 2008 Show us your code... Link to comment https://forums.phpfreaks.com/topic/93670-help/#findComment-479898 Share on other sites More sharing options...
conker87 Posted February 29, 2008 Share Posted February 29, 2008 Code? Error messages? Need more info please. Link to comment https://forums.phpfreaks.com/topic/93670-help/#findComment-479900 Share on other sites More sharing options...
djbuddhi Posted March 1, 2008 Author Share Posted March 1, 2008 i just used $_POST['telno']; it gives an error of mysql insert error Link to comment https://forums.phpfreaks.com/topic/93670-help/#findComment-480558 Share on other sites More sharing options...
trq Posted March 1, 2008 Share Posted March 1, 2008 Post your code for the query as well, we need the relevant code! Link to comment https://forums.phpfreaks.com/topic/93670-help/#findComment-480559 Share on other sites More sharing options...
djbuddhi Posted March 1, 2008 Author Share Posted March 1, 2008 in the insert quey i have put addslashes($_POST['telno']) i want o insert telephone numbers like this +44 (0) 20 8300 7744 (24hrs) Link to comment https://forums.phpfreaks.com/topic/93670-help/#findComment-480864 Share on other sites More sharing options...
ILYAS415 Posted March 1, 2008 Share Posted March 1, 2008 hehe lol post your full code Link to comment https://forums.phpfreaks.com/topic/93670-help/#findComment-480889 Share on other sites More sharing options...
djbuddhi Posted March 1, 2008 Author Share Posted March 1, 2008 $sever_name=ucwords(strtolower($_POST['agent_name'])); $server_address=addslashes(trim(($_POST['set_address'])); $se_telno=addslashes(($_POST['set_ag_telno']); $set_faxno=addslashes(($_POST['set_ag_fax_no']); $set_email=($_POST['set_ag_email_no']; $setl_id=($_POST['settle_agent']; $set_townid=($_POST['mytown']; $blank_check=checkblank($sever_name,$server_address,$se_telno,$set_faxno,$set_email,$setl_id,$set_townid); if($blank_check==true){ $er_msges="<br/><br/> <font size=2 color=#FF0000><b> Error In Data Submitting ...! Please Try Again ..! </b> </font><br/><br/><br/>"; } else{ if (!preg_match("/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/",$set_email)){ $er_msges="<b><font size=2 color=#FF0000>E-mail Address :".' '.' '.$set_email." Not a valid Email Address Format...! </font></b>"; } else{ //$check_exixts=check_server_argent_exits($sever_name); //if($check_exixts ==true ){ $er_msges= "<b><font size=2 color=#FF0000>Server agent ".' '.' '.$sever_name." Exists in the system ...! </font></b>"; //} //else{ $query_101 = "INSERT INTO ual_admin_server_agent (ad_server_agent_name,ad_server_agent_address,ad_server_agent_telno,ad_server_agent_fax_no,ad_server_agent_email,ad_server_agent_settle_agent_id,ad_server_agent_town_id,ad_server_agent_modify_status,ad_server_agent_del_status,ad_server_agent_ustate,ad_server_agent_add_date) VALUES('$sever_name','$server_address',$se_telno,$set_faxno,'$set_email',$setl_id,$set_townid,'N','N','N','$today')"; $result_101 = mysql_query($query_101) ; if($result_101){ $er_msges= "<b><font size=2s color=#000000>Server Agent".' '.' '.$sever_name." Suceessfully Saved In The System ...! </font></b>"; } else{ $er_msges= "<b><font size=2s color=#FF0000>Server Agent".' '.' '.$sever_name." Added to the system Fails...! </font></b>"; } // } //} //perg web address } ///preg else } //if fist else Link to comment https://forums.phpfreaks.com/topic/93670-help/#findComment-481073 Share on other sites More sharing options...
djbuddhi Posted March 1, 2008 Author Share Posted March 1, 2008 $sever_name=ucwords(strtolower($_POST['agent_name'])); $server_address=addslashes(trim(($_POST['set_address'])); $se_telno=addslashes(($_POST['set_ag_telno']); $set_faxno=addslashes(($_POST['set_ag_fax_no']); $set_email=($_POST['set_ag_email_no']; $setl_id=($_POST['settle_agent']; $set_townid=($_POST['mytown']; $blank_check=checkblank($sever_name,$server_address,$se_telno,$set_faxno,$set_email,$setl_id,$set_townid); if($blank_check==true){ $er_msges="<br/><br/> <font size=2 color=#FF0000><b> Error In Data Submitting ...! Please Try Again ..! </b> </font><br/><br/><br/>"; } else{ if (!preg_match("/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/",$set_email)){ $er_msges="<b><font size=2 color=#FF0000>E-mail Address :".' '.' '.$set_email." Not a valid Email Address Format...! </font></b>"; } else{ //$check_exixts=check_server_argent_exits($sever_name); //if($check_exixts ==true ){ $er_msges= "<b><font size=2 color=#FF0000>Server agent ".' '.' '.$sever_name." Exists in the system ...! </font></b>"; //} //else{ $query_101 = "INSERT INTO ual_admin_server_agent (ad_server_agent_name,ad_server_agent_address,ad_server_agent_telno,ad_server_agent_fax_no,ad_server_agent_email,ad_server_agent_settle_agent_id,ad_server_agent_town_id,ad_server_agent_modify_status,ad_server_agent_del_status,ad_server_agent_ustate,ad_server_agent_add_date) VALUES('$sever_name','$server_address',$se_telno,$set_faxno,'$set_email',$setl_id,$set_townid,'N','N','N','$today')"; $result_101 = mysql_query($query_101) ; if($result_101){ $er_msges= "<b><font size=2s color=#000000>Server Agent".' '.' '.$sever_name." Suceessfully Saved In The System ...! </font></b>"; } else{ $er_msges= "<b><font size=2s color=#FF0000>Server Agent".' '.' '.$sever_name." Added to the system Fails...! </font></b>"; } // } //} //perg web address } ///preg else } //if fist else Link to comment https://forums.phpfreaks.com/topic/93670-help/#findComment-481074 Share on other sites More sharing options...
ILYAS415 Posted March 1, 2008 Share Posted March 1, 2008 tsssk tssk cant read ur code. put [ code ] tags around it (leave the spaces i made out) basically lyk... [code]text here[/ code] make sure to remove that space i made in [/code] Link to comment https://forums.phpfreaks.com/topic/93670-help/#findComment-481082 Share on other sites More sharing options...
AndyB Posted March 1, 2008 Share Posted March 1, 2008 $result_101 = mysql_query($query_101) ; Add proper error trapping to that to see what's wrong. Thus $result_101 = mysql_query($query_101) or die("Error: ". mysql_error(). " with query ". $query_101); What's wrong with your presently constructed query is that some of the values are wrapped with single quotes and others are not. Wrap EACH value with single quotes and try again. Link to comment https://forums.phpfreaks.com/topic/93670-help/#findComment-481137 Share on other sites More sharing options...
djbuddhi Posted March 2, 2008 Author Share Posted March 2, 2008 I WANT TO INSERT TELEPHONE NUMBERS LIKE 11212111, 21112 12121 AND ITS GIVES AND ERROR .HOW TO OVER COME IT Link to comment https://forums.phpfreaks.com/topic/93670-help/#findComment-481971 Share on other sites More sharing options...
ILYAS415 Posted March 11, 2008 Share Posted March 11, 2008 What exactly is the error? Link to comment https://forums.phpfreaks.com/topic/93670-help/#findComment-489994 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.