> ...and some bytes may represent an 'illegal' character, and thus must be
> escaped by a backslash... this goes for the quote character you use (" or
> '), the backslash character itself, and null bytes.
Thanks, if I use mysql_real_query is this still the case?
--
David A. C. Beck
[EMAIL PROTECTED]
Valerie Daggett Laboratory
Biomolecular Structure and Design Program
Department of Medicinal Chemistry
University of Washington, Seattle
On Tue, 2 Jul 2002, Roger Baklund wrote:
> * Dave Beck
> [...]
> > > char insert_format[] = "INSERT INTO %s VALUES (%hhd%hhd%hhd%hhd,
> > > %hhd%hhd%hhd%hhd, %hhd%hhd%hhd%hhd, %hhd%hhd%hhd%hhd,%hhd%hhd%hhd%hhd)";
>
> The values should be quoted...
>
> > > int build_real_insert(char *query, char *table, int frame, int
> > atom, float
> > > x, float y, float z) {
> > > unsigned char *fbp = (unsigned char *)&frame;
> > > unsigned char *abp = (unsigned char *)&atom;
> > > unsigned char *xbp = (unsigned char *)&x;
> > > unsigned char *ybp = (unsigned char *)&y;
> > > unsigned char *zbp = (unsigned char *)&z;
> > >
> > > return sprintf(query, insert_format, table, fbp[0], fbp[1],
> > > fbp[2], fbp[3], abp[0], abp[1], abp[2], abp[3], xbp[0], xbp[1], xbp[2],
> > > xbp[3], ybp[0], ybp[1], ybp[2], ybp[3], zbp[0], zbp[1], zbp[2], zbp[3]);
> > > }
>
> ...and some bytes may represent an 'illegal' character, and thus must be
> escaped by a backslash... this goes for the quote character you use (" or
> '), the backslash character itself, and null bytes.
>
> --
> Roger
> sql
>
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php