473,327 Members | 1,896 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

You have an error in your SQL syntax; check the manual that corresponds to your MySQL

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. require_once ("inc/dbconnection.php");
  3.  
  4. class provider_function
  5. {
  6.  public $select_query;
  7.  public $select_result;
  8.  public $insert_query;
  9.  public $insert_result;
  10.  public $update_query;
  11.  public $update_result;
  12.  public $select_row;
  13.         public function select($id)
  14.         {
  15.             $this->select_query = "SELECT * FROM m_tbl_ServiceProvider where intProviderID =".$id;
  16.             $this->select_result = mysql_query($this->select_query) or die(mysql_error());
  17.             $this->select_row = mysql_fetch_assoc($this->select_result);
  18.             return $this->select_row;
  19.         }
  20.         public function insert($bo)
  21.         {
  22.             $this->insert_query="INSERT INTO m_tbl_ServiceProvider (str_Name,str_AgencyName,str_Address1,str_Address2,str_City,int_PinCode,str_Email,str_FromDay,str_ToDay,str_HourAm,str_HourPm,int_PhoneNumber,str_LoginName,str_Password,str_ProviderType) VALUES 
  23.                                                              ('".$bo->str_Name."','".$bo->str_AgencyName."','".$bo->str_Address1."','".$bo->str_Address2."','".$bo->str_City."',".$bo->int_PinCode.",'".$bo->str_Email."','".$bo->str_FromDay."','".$bo->str_ToDay."','".$bo->str_HourAm."','".$bo->str_HourPm."',".$bo->int_PhoneNumber.",'".$bo->str_LoginName."','".$bo->str_Password."','".$bo->str_ProviderType."')";
  24.             $this->insert_result = mysql_query($this->insert_query) or die(mysql_error());
  25.             return $this->insert_result;
  26.         }
  27.         public function update($id,$bo)
  28.         {
  29.  
  30.             $this->update_query = "update m_tbl_ServiceProvider set str_Name = '".$bo->str_Name."',str_AgencyName = '".$bo->str_AgencyName."',str_Address1 = '".$bo->str_Address1."',str_Address2 = '".$bo->str_Address2."',str_City = '".$bo->str_City."',
  31.                                                               int_PinCode=".$bo->int_PinCode.",str_Email='".$bo->str_Email."',str_FromDay='".$bo->str_FromDay."',str_ToDay='".$bo->str_ToDay."',str_HourAm='".$bo->str_HourAm."',str_HourPm='".$bo->str_HourPm."',
  32.                                                               int_PhoneNumber=".$bo->int_PhoneNumber.",str_LoginName='".$bo->str_LoginName."',str_Password='".$bo->str_Password."',str_ProviderType = '".$bo->str_ProviderType."' where intProviderID=".$id;
  33.             $this->update_result = mysql_query($this->update_query) or die(mysql_error());
  34.             return $this->update_result;
  35.         }
  36. }
  37. ?>
when ever i call this function the following error wil come please clarify my problem

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''janu','sat','Handyman Services')' at line 2
Oct 15 '10 #1
1 1144
Atli
5,058 Expert 4TB
On line #23, there looks like there is something wrong with the $bo->int_PhoneNumber value. Are you sure it has a value?
Oct 16 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Wayne | last post by:
Hi, Can someone possibly assist me in finding the error in the following: echo "<p><strong>".($i+1).". Login: "; I get the following error returned when doing a syntax check PHP Parse...
1
by: beary | last post by:
Could someone please tell me what's wrong with the code below. It worked fine the first time, then I cleared the table (results) and tried it again, but got the message "You have an error in your SQL...
8
mmarif4u
by: mmarif4u | last post by:
Hi everybody... I want to enter values to db like the following,,, Format is like this (810605-14-6356) This is the rite format, No a to z letters... 6 digits then - then 2 digits then - then 4...
6
by: markodilore | last post by:
Hey Guys, you helped me once when I tryied to create a database : "Access denied for user ''@'localhost' ". On my Mac OS 10.4, I had no problem creating database and modifying it from the terminal....
10
by: bobf | last post by:
I am using a program 'My Contact Table' which is a code generator program. It allows you to easily create a PHP/MySQL web application without writing any code. I am trying to create an additional...
4
by: FM | last post by:
Hi there: My question is about checking my sql-syntax against DB2UDB V9 throug JDBC 2.0 Is there a way to check my syntax,for example "select * from T1"? Thank you for your help. Regards,
6
by: zmee | last post by:
Hi, I'm doing a little game in OpenGL for college and I've got these 3 classes in C++: WarBalls - represents the Game's Application. It is supposed to be a singleton and holds all the Game's...
6
by: muby | last post by:
Hi everybody :) I'm modifying a C++ code in VC++ 2005 my code snippet void BandwidthAllocationScheduler::insert( Message* msg, BOOL* QueueIsFull,
1
by: dreamy | last post by:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sum( ) VALUES ()' at line 1 This is my code <?php //make...
9
by: icemaster451 | last post by:
Hello im making a browser game and have 99% working but iv got one error i cant find / fix and would like to know if anyone can help me where im going wrong heres the error QUERY ERROR: You have an...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.