Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Quick PHP and/or MySQL question

Reply
Thread Tools

Quick PHP and/or MySQL question

 
 
Paul F. Johnson
Guest
Posts: n/a
 
      06-05-2005
Hi,

I'm developing something for a friend and for some reason, my mind has
gone wibble and I've forgotten something.

Point your browsers at http://82.42.51.231/cta/pchardware/video.php and
you'll see it virtually instantly. Around the text in the first two
columns are quote marks.

I'm using PHP to access a MySQL database and I have a feeling the quotes
are part of the dataset imported. I either need to strip the quotes from
the SQL database *or* in the PHP. Question is, how do I do either of
them?

All my books on this are at work. It's been a hectic weekend and my mind
is giving up. Help would be appreciated

TTFN

Paul
--
"Space", it says, "is big. Really big. You just won't believe how
vastly, hugely, mind-bogglingly big space really is. I mean, you may
think it's a long way down the road to the chemists, but that's just
*peanuts* compared to space, listen" - Hitch Hikers Guide to the Galaxy

 
Reply With Quote
 
 
 
 
Adrienne
Guest
Posts: n/a
 
      06-06-2005
Gazing into my crystal ball I observed "Paul F. Johnson" <paul@all-the-
johnsons.co.uk> writing in news:1118010854.3910.13.camel@localhost:

> Hi,
>
> I'm developing something for a friend and for some reason, my mind has
> gone wibble and I've forgotten something.
>
> Point your browsers at http://82.42.51.231/cta/pchardware/video.php and
> you'll see it virtually instantly. Around the text in the first two
> columns are quote marks.
>
> I'm using PHP to access a MySQL database and I have a feeling the quotes
> are part of the dataset imported. I either need to strip the quotes from
> the SQL database *or* in the PHP. Question is, how do I do either of
> them?
>
> All my books on this are at work. It's been a hectic weekend and my mind
> is giving up. Help would be appreciated
>
> TTFN
>
> Paul


Single quotes are used in SQL statements as delimiters and must be escaped.
I use a tilde mark, and have created functions to replace ' with ~ for
inserts/updates and replace ~ with ' when printing out the recordset.

--
Adrienne Boswell
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
 
Reply With Quote
 
 
 
 
Hywel Jenkins
Guest
Posts: n/a
 
      06-06-2005
In article <Xns966D6FB019EBAarbpenyahoocom@207.115.63.158>, arbpen2003
@sbcglobal.net says...
> Gazing into my crystal ball I observed "Paul F. Johnson" <paul@all-the-
> johnsons.co.uk> writing in news:1118010854.3910.13.camel@localhost:
>
> > Hi,
> >
> > I'm developing something for a friend and for some reason, my mind has
> > gone wibble and I've forgotten something.
> >
> > Point your browsers at http://82.42.51.231/cta/pchardware/video.php and
> > you'll see it virtually instantly. Around the text in the first two
> > columns are quote marks.
> >
> > I'm using PHP to access a MySQL database and I have a feeling the quotes
> > are part of the dataset imported. I either need to strip the quotes from
> > the SQL database *or* in the PHP. Question is, how do I do either of
> > them?
> >
> > All my books on this are at work. It's been a hectic weekend and my mind
> > is giving up. Help would be appreciated
> >
> > TTFN
> >
> > Paul

>
> Single quotes are used in SQL statements as delimiters and must be escaped.
> I use a tilde mark, and have created functions to replace ' with ~ for
> inserts/updates and replace ~ with ' when printing out the recordset.


How about addslashes() and stripslashes() for PHP? With PHP, the server
admin. can enable MAGIC_QUOTES which takes care of this for you. It's
worth coding for the eventuality that the magic quotes setting will be
reversed by checking whether they're on or not. The PHP docs has info.
on this.

--
Hywel

Kill the Crazy Frog
http://www.petitiononline.com/crzyfrg/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP MySQL Web Development - Why Do You Need a PHP & MySQL ... neha shena Python 1 10-29-2010 04:54 AM
PHP MySQL Web Development - Why Do You Need a PHP & MySQL ... neha shena C Programming 0 10-28-2010 06:00 PM
FREE SEMINAR on PHP Web Development in Lahore, It covers PHP, MySQL,AJAX & Zend Certification EVS MCSE 0 08-08-2010 12:41 PM
FREE SEMINAR on PHP Web Development in Lahore and Rawalpindi, Itcovers PHP, MySQL, AJAX & Zend Certification EVS MCSE 0 05-31-2010 01:13 PM
PHP Training Institute In Delhi, Live Projects on PHP. Short TermPHP Courses, PHP Scripts, PHP Training with Live Projects. Rajive Narain Java 0 09-18-2009 10:47 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57