473,946 Members | 2,110 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1233
Atli
5,058 Recognized Expert Expert
On line #23, there looks like there is something wrong with the $bo->int_PhoneNumbe r 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
1542
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 error: parse error, unexpected '>' in c:\wayne\results.php on line 37
1
1460
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 syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1". Problem is I can't see any " near line. And it worked fine the first time. What am I missing? Thankyou. <?php ...
8
1946
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 digits. dbConnect('db');
6
6336
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. But I use Dreamweaver 8 to connect to MySQL, with its built-in feature "MySQL Connection" I write this: Connection Name: con_test001 MySQL Server: localhost User Name: root Password: 55555 Database: test001 (which is a database I already...
10
50051
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 data entry page. I have copied an existing page and created a new table in my database. When I run the script I get the error message "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right...
4
10863
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
5877
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 Managers. #ifndef WARBALLS_H #define WARBALLS_H #include "cg/cg.h"
6
38113
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
2016
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 conection $name=$_POST; $cloth=$_POST; $bag=$_POST;
9
2309
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 error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 0, '1', '2121221', '1212121', '12121', '12121', 1211, '121', 121)' at line 1 Query was INSERT INTO crimes (crimeNAME,...
0
9975
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11552
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11142
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11325
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
8240
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7404
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6097
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4928
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4525
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.