hei coild somebody help me with ajax mysql ?
I use ajax to put data to my database but why i can not put the charector like ' \ ? for example i want to put the word DON'T which has the 'it could not do it why ? what should i do ?
7 1811
I can not put the charector like \ ' to the data base.
I use ajax to put the data to my database and i found today that i can not put these kinds of charector to my database at all. every word which contents ' can not be sent for example don't can't \
But when i tried to put the data to database with the normal method (none ajax) so i could do that.
Ajax is cool and quick but how could i fix this problem ? have somebody here the same prblem as me ?
acoder 16,027
Recognized Expert Moderator MVP
Welcome to Bytes!
If that suggestion doesn't work, post your code.
PS. posts split off from other threads. Please post a new thread for posts rather than hijacking other members' threads. Thanks.
Hi,
How to do that ?
I tried this one but atill not work - // $sql= sprintf("INSERT INTO tb_music VALUES ('$playlist_id','$playlist_name','$user_id','$song','$artist','$plass')",,
-
mysql_real_escape_string($artist, $sql),
-
mysql_real_escape_string($plass, $sql),
-
mysql_real_escape_string($playlist_name, $sql),
-
mysql_real_escape_string($playlist_id, $sql));
-
-
//
acoder 16,027
Recognized Expert Moderator MVP
That's not correct PHP. Have you had a look at the PHP manual? You mentioned that your code worked when not using Ajax. Are you sure about that?
oh yeah, i got it.
it's just one line to fix it and it is:
$artist = mysql_real_escape_string($_POST['artist']);
your answer is my angel you know ? if i don't have you maybe i have tp geot headach for more time. thanks so much.
acoder 16,027
Recognized Expert Moderator MVP
That looks more like it. Glad to see that you fixed it.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: David Cameron |
last post by:
I noticed
that using an HTMLInputRadioButton and specifying a value to be an empty
string (""), this is overridden by ASP.Net which set the value of the
control to be the same as the ID of the...
|
by: Giggle Girl |
last post by:
I have inherited some CSS from a former employee that has code like
this:
onmouseover="this.className='highlight_on standard_border'"
where it appears to activate two different classes,...
|
by: VK |
last post by:
Let's say I have a rather big HTML template like
<?xml version="1.0" encoding="ISO-8859-1"?>
....
<snip>
....
<xsl:template match="/">
<html>
<!-- ...
A lot of HTML but no XSL so far
|
by: thepisu |
last post by:
I have a Windows 2003 Server with IIS 6, PHP with CGI.
Yesterday I decided to update from PHP 5.1.4 to 5.2.1, but "slash
arguments" (in a Moodle installation) stop working, I mean addresses
like...
|
by: Tonio Tanzi |
last post by:
I have an asp page with this tag
<body onLoad="show_msg('<%=error_msg%>');">
where "show_msg" is a javascript function that shows the message
contained in the asp variable "error_msg" only if...
| |
by: Tony Toews [MVP] |
last post by:
I'm very upset with Google's policy of indexing and allowing Google
advertising on forum web sites which are "slurping" content from
Usenet and Microsoft newsgroup servers.
...
|
by: Robertf987 |
last post by:
Hi,
Yet another thing I need help with I'm affraid. I'll first explain what I want, then I'll try to explain what I have. I'm using Microsoft Access 2000.
What I want is to be able to do a...
|
by: holmes86 |
last post by:
hi,everyone
I have a GTK window,when click "close window" ,I want to show a verify dialog that whether verify really quit or not.so I used a MesssageDialog for verify quit.But when I clicked the...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
|
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...
| |
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |