| | |
Sending quotes to my database
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Aug 2005
Posts: 9
Reputation:
Solved Threads: 0
I've got an insert statement where there is a memo field that can easily contain quotes or single quotes or apostrophes. I cannot get it to insert I have tried with replacing the aposatrophe with a \', doesn't like it i have also tried
if (get_magic_quotes_gpc()==1) {
$notes = stripslashes(ereg_replace('"','"',$_POST["other_notes"])) ;
} else {
$notes = addslashes ( $string );
}
the following is the sql statement:
Insert into lead_lines(empID, leadID, date_, notes) VALUES(1,14,'8/19/2005',' This guy seems like a real easy going dude. Might've been high when he ordered.')
How can I make the database except this???
It's stressing me out.
Thanks
if (get_magic_quotes_gpc()==1) {
$notes = stripslashes(ereg_replace('"','"',$_POST["other_notes"])) ;
} else {
$notes = addslashes ( $string );
}
the following is the sql statement:
Insert into lead_lines(empID, leadID, date_, notes) VALUES(1,14,'8/19/2005',' This guy seems like a real easy going dude. Might've been high when he ordered.')
How can I make the database except this???
It's stressing me out.
Thanks
Do you have phpMyAdmin? If so I would make an insert with that and make sure you use your single or double quotes, which ever you want. - And see how it does the job. It will make the insert and show the query that was used
So are your employees using a form that you made? I hope their not allowed to make the query theirselves.
So if your using a form, you'll just have to format the string to be exactly what the phpmyadmin gave you
So if your using a form, you'll just have to format the string to be exactly what the phpmyadmin gave you
![]() |
Similar Threads
- nested joins, from mdb. Possible? (Visual Basic 4 / 5 / 6)
- credit card validate (PHP)
- Entourage Slow sending pdf files (Mac Software)
- help connecting a form to a database.. error message (ASP.NET)
Other Threads in the PHP Forum
- Previous Thread: Urgent help needed installing!
- Next Thread: Memory Limitations?? with PHP affecting pdf generation
| Thread Tools | Search this Thread |
.htaccess action ajax apache api array auto beginner binary bounce broken cakephp checkbox class cms code cron curl database date display dynamic echo email error errorlog file files folder form format forms function functions google href htaccess html image include insert integration interactive ip java javascript joomla limit link login loop mail malfunctioning masterthesis menu mlm mod_rewrite multiple mysql nodes oop paypal pdf php popup problem query radio ram random recursion reference regex remote return script search server sessions sms soap source space sql syntax system table tutorial unset update upload url validation validator variable video web websitecontactform xml youtube





