On 24-Apr-09 03:45, Chris wrote:
I don't think mysql has any way of finding that out. If you're using an
abstraction layer, it's easy enough in code - though rollback's are a
little harder - should they do a complete rollback or just to a savepoint?
Thank you for taking the time to sketch that
On Wed, Apr 22, 2009 at 10:25 AM, Jan G.B. ro0ot.w...@googlemail.com wrote:
2009/4/21 Per Jessen p...@computer.org:
Jan G.B. wrote:
A web application that uses an external db server would be quite ...
uhm... slow! Anyone did this, yet? ;)
Certainly, and it's not slow. It depends entirely
Bogdan Stancescu wrote:
Hello list,
I'm developing a library and would need to know if the code calling my
library has already started a MySQL transaction or not. I want to know
whether I should start one or use savepoints instead -- starting a
transaction if one is already in progress commits
2009/4/21 Per Jessen p...@computer.org:
Jan G.B. wrote:
A web application that uses an external db server would be quite ...
uhm... slow! Anyone did this, yet? ;)
Certainly, and it's not slow. It depends entirely on your connection to
the public internet.
As we're speaking of the
Grega Leskovsek wrote:
provided I want to store hash of a password in MySQL ... Using MySQL,
the whole check can be achieved with a SQL query, since the MD5
function is provided as part of the database query language ...
Can I use also SHA1 or must I use MD5?
You could have just checked
On Tue, Apr 21, 2009 at 8:34 AM, Grega Leskovsek mavri...@gmail.com wrote:
provided I want to store hash of a password in MySQL ... Using MySQL,
the whole check can be achieved with a SQL query, since the MD5
function is provided as part of the database query language ...
Can I use also SHA1
2009/4/21 Andrew Ballard aball...@gmail.com:
On Tue, Apr 21, 2009 at 8:34 AM, Grega Leskovsek mavri...@gmail.com wrote:
provided I want to store hash of a password in MySQL ... Using MySQL,
the whole check can be achieved with a SQL query, since the MD5
function is provided as part of the
Jan G.B. wrote:
A web application that uses an external db server would be quite ...
uhm... slow! Anyone did this, yet? ;)
Certainly, and it's not slow. It depends entirely on your connection to
the public internet.
--
Per Jessen, Zürich (18.2°C)
--
PHP General Mailing List
Andrew Ballard wrote:
On Tue, Apr 21, 2009 at 8:34 AM, Grega Leskovsek mavri...@gmail.com wrote:
provided I want to store hash of a password in MySQL ... Using MySQL,
the whole check can be achieved with a SQL query, since the MD5
function is provided as part of the database query language ...
:38:01 -0400
To: defati...@hotmail.com; php-general@lists.php.net
From: tedd.sperl...@gmail.com
Subject: Re: [PHP] MYSQL TABLES (One To Many Relationship)
At 5:04 PM +0100 3/22/09, abdulazeez alugo wrote:
Hi guys,
I need help on something I'm working on and its really eating me up
so I'll
At 5:04 PM +0100 3/22/09, abdulazeez alugo wrote:
Hi guys,
I need help on something I'm working on and its really eating me up
so I'll appreciate any help I can get on it.
I'm writing code for a site that posts a topic for discussion and
accepts comments (Just like a parliament).
There
Chris wrote:
That won't tell you where a query comes from ;) Add a debug_backtrace
into the class to also pinpoint where the query was called from.
Complicated queries built on variables (or even just long queries
built over multiple lines) will be hard to find just by looking at the
mysql
2009/1/21 Jay Moore jaymo...@accu-com.com
This is a MySQL class I use and I wanted to get everyone's thoughts on
how/if I can improve it. This is for MySQL only. I don't need to make it
compatible with other databases. I'm curious what you all think.
Thanks,
Jay
Hey,
1. You know the
On Wed, Jan 21, 2009 at 9:45 AM, Edmund Hertle
edmund.her...@student.kit.edu wrote:
2009/1/21 Jay Moore jaymo...@accu-com.com
This is a MySQL class I use and I wanted to get everyone's thoughts on
how/if I can improve it. This is for MySQL only. I don't need to make it
compatible with other
On Wed, Jan 21, 2009 at 12:45 PM, Edmund Hertle
edmund.her...@student.kit.edu wrote:
2009/1/21 Jay Moore jaymo...@accu-com.com
This is a MySQL class I use and I wanted to get everyone's thoughts on
how/if I can improve it. This is for MySQL only. I don't need to make it
compatible with
On Wed, Jan 21, 2009 at 11:37:07AM -0600, Jay Moore wrote:
This is a MySQL class I use and I wanted to get everyone's thoughts on
how/if I can improve it. This is for MySQL only. I don't need to make
it compatible with other databases. I'm curious what you all think.
Thanks,
Jay
Class:
This is a MySQL class I use and I wanted to get everyone's thoughts on
how/if I can improve it. This is for MySQL only. I don't need to make it
compatible with other databases. I'm curious what you all think.
I have a similar thing I use, which uses the same (or at least very
similar) API
Paul M Foster schreef:
On Wed, Jan 21, 2009 at 11:37:07AM -0600, Jay Moore wrote:
This is a MySQL class I use and I wanted to get everyone's thoughts on
how/if I can improve it. This is for MySQL only. I don't need to make
it compatible with other databases. I'm curious what you all
On January 21, 2009 12:37:07 Jay Moore wrote:
This is a MySQL class I use and I wanted to get everyone's thoughts on
how/if I can improve it. This is for MySQL only. I don't need to make
it compatible with other databases. I'm curious what you all think.
I definetly think that using a DB
Good ideas guys. The input is much appreciated.
Jochem (and anyone else, I guess), as I am not 100% versed with
Exceptions, the php5 version you suggested, are those Exceptions able to
be handled outside the class?
Do I need my try block to be within the class block, or can I have the
try
On Wed, Jan 21, 2009 at 09:10:54PM +0100, Jochem Maas wrote:
Paul M Foster schreef:
On Wed, Jan 21, 2009 at 11:37:07AM -0600, Jay Moore wrote:
This is a MySQL class I use and I wanted to get everyone's thoughts on
how/if I can improve it. This is for MySQL only. I don't need to make
On Wed, Jan 21, 2009 at 02:30:00PM -0600, Jay Moore wrote:
Good ideas guys. The input is much appreciated.
Jochem (and anyone else, I guess), as I am not 100% versed with
Exceptions, the php5 version you suggested, are those Exceptions able to
be handled outside the class?
Do I need my
Jay Moore schreef:
Good ideas guys. The input is much appreciated.
Jochem (and anyone else, I guess), as I am not 100% versed with
Exceptions, the php5 version you suggested, are those Exceptions able to
be handled outside the class?
Do I need my try block to be within the class block,
I know it's very OO-y to use exceptions, but I hate them. They're like
setjmp/longjmp calls in C, and they're a really headache to deal with.
If you don't use default or predone handlers, you have to put all kinds
of try/catch blocks around everything. They make for non-linear
execution, and I
Jay Moore schreef:
I know it's very OO-y to use exceptions, but I hate them. They're like
setjmp/longjmp calls in C, and they're a really headache to deal with.
If you don't use default or predone handlers, you have to put all kinds
of try/catch blocks around everything. They make for
2009/1/21 Jay Moore jaymo...@accu-com.com
I know it's very OO-y to use exceptions, but I hate them. They're like
setjmp/longjmp calls in C, and they're a really headache to deal with.
If you don't use default or predone handlers, you have to put all kinds
of try/catch blocks around
there is an art to using them, they compliment 'traditional' error
handling, and I agree they can hinder if used badly.
I don't think I've ever seen Exceptions used well...
Invariably, I end up having to write a wrapper function around every function
implemented and catch all the
c...@l-i-e.com wrote:
there is an art to using them, they compliment 'traditional' error
handling, and I agree they can hinder if used badly.
I don't think I've ever seen Exceptions used well...
Invariably, I end up having to write a wrapper function around every function
implemented and
On Wed, Jan 21, 2009 at 10:00:53PM +0100, Jochem Maas wrote:
Jay Moore schreef:
I know it's very OO-y to use exceptions, but I hate them. They're like
setjmp/longjmp calls in C, and they're a really headache to deal with.
If you don't use default or predone handlers, you have to put all
Nathan Rixham schreef:
c...@l-i-e.com wrote:
there is an art to using them, they compliment 'traditional' error
handling, and I agree they can hinder if used badly.
I don't think I've ever seen Exceptions used well...
Invariably, I end up having to write a wrapper function around every
Eric Butera wrote:
On Wed, Jan 21, 2009 at 12:45 PM, Edmund Hertle
edmund.her...@student.kit.edu wrote:
2009/1/21 Jay Moore jaymo...@accu-com.com
This is a MySQL class I use and I wanted to get everyone's thoughts on
how/if I can improve it. This is for MySQL only. I don't need to make it
I prefer to deal with the issues locally, or have a documented behaviour with
return values and error details available, much like most of PHP
extensions/internals.
try/catch ends up with weird code organization, imho, especially when you can
only really handle some exceptions.
For real
On Wed, Jan 21, 2009 at 5:53 PM, Chris dmag...@gmail.com wrote:
Eric Butera wrote:
On Wed, Jan 21, 2009 at 12:45 PM, Edmund Hertle
edmund.her...@student.kit.edu wrote:
2009/1/21 Jay Moore jaymo...@accu-com.com
This is a MySQL class I use and I wanted to get everyone's thoughts on
how/if I
Yea if you're only targeting 1 db, then why not use that class? At
least then there's the php manual to figure out what something does.
Because then to add query logging for the whole app, you just need to put it
in the class :)
(I've done that before to check what's being run and where
On Wed, Jan 21, 2009 at 6:09 PM, Chris dmag...@gmail.com wrote:
Yea if you're only targeting 1 db, then why not use that class? At
least then there's the php manual to figure out what something does.
Because then to add query logging for the whole app, you just need to put
it
in the class
Chris schreef:
Yea if you're only targeting 1 db, then why not use that class? At
least then there's the php manual to figure out what something does.
Because then to add query logging for the whole app, you just need to
put it
in the class :)
(I've done that before to check what's being
On Wed, Jan 21, 2009 at 6:37 PM, Jochem Maas joc...@iamjochem.com wrote:
Chris schreef:
Yea if you're only targeting 1 db, then why not use that class? At
least then there's the php manual to figure out what something does.
Because then to add query logging for the whole app, you just need
On Wed, 2009-01-21 at 18:52 -0500, Eric Butera wrote:
On Wed, Jan 21, 2009 at 6:37 PM, Jochem Maas joc...@iamjochem.com wrote:
Chris schreef:
Yea if you're only targeting 1 db, then why not use that class? At
least then there's the php manual to figure out what something does.
Because
On Wed, Jan 21, 2009 at 7:07 PM, Ashley Sheridan
a...@ashleysheridan.co.uk wrote:
On Wed, 2009-01-21 at 18:52 -0500, Eric Butera wrote:
On Wed, Jan 21, 2009 at 6:37 PM, Jochem Maas joc...@iamjochem.com wrote:
Chris schreef:
Yea if you're only targeting 1 db, then why not use that class?
PHP had a built-in MySQL for awhile as I recall.
You had to explicitly use --with-mysql=/usr/local (or wherever you put your
mysql headers/libs) to make it choose the one you wanted.
Even if it's not using built-in, it may have found an old install of your
MySQL rather than your shiny new
Thing is, I have MySQL 5.0.67 installed, and I've never had MySQL 4 on
this box (Xserve G5, Mac OS X Server 10.4.11). Here's my configure
command:
./configure --prefix=/usr/local/php5 --mandir=/usr/share/man --
infodir=/usr/share/info --with-apxs --with-ldap=/usr --with-kerberos=/
usr
Historically, mysql has been both an external extension, and a built-in part of
the source, depending on the version of PHP.
Your current experience would indicate that it's only external in 5.2.8, but I
cannot confirm nor deny that.
How is MySQL installed?
If it's rpm, do you have
The mysql forum is the best place. Note that their holiday schedule
may mean some lag in getting answers.
Bastien
Sent from my iPod
On Dec 29, 2008, at 7:51 AM, ann kok oiyan...@yahoo.ca wrote:
Hi all
Do you know any websites for mysql question?
I do submit the mysql forum but I would
Jim Lucas wrote:
[EMAIL PROTECTED] wrote:
Ok, so just that I am clear, you are SELECTing and pulling all the data
that you are submitting in the above INSERT statement from the DB
initially,
then you are only modifying the confirm_number value and then re-
submitting all the values, as they
Chris wrote:
Jim Lucas wrote:
[EMAIL PROTECTED] wrote:
Ok, so just that I am clear, you are SELECTing and pulling all the
data that you are submitting in the above INSERT statement from the
DB initially,
then you are only modifying the confirm_number value and then re-
submitting all the
Michael S. Dunsavage wrote:
On Fri, 2008-11-14 at 12:46 -0800, Jim Lucas wrote:
SELECT @confirm_number AS confirm_number;
Are we not SELECTING the column value here? should we be selecting
confirm_number as confirm_number?
The idea is to give you the number that was used in the INSERT
On Fri, 2008-11-14 at 08:46 +0100, Jochem Maas wrote:
1000 + 1 != 10001
you might consider setting a default of 1000 or 1 or whatever on
the given
field so it's automatically populated with that number when a contact
record is
created.
Sorry. Hit the 0 one to few times.
--
Michael S.
okay I want to pull an integer from a database called confirm_number,
add 1 and repost it back to the database
here's the code I'm using.
$queryconfirm=SELECT confirm_number from contacts ORDER BY contact DESC
LIMIT 1;
I assume that you are already aware that if you set the variable
I would create a separate table for this (confirmation_numbers or something)
with an autoincrement primary key. That way you can simply insert a new
record for you contact and then ask (using mysql_insert_id()) what the
confirmation number is.
This approach is much safer as you can be 100% sure
On Fri, Nov 14, 2008 at 9:58 AM, [EMAIL PROTECTED] wrote:
okay I want to pull an integer from a database called confirm_number,
add 1 and repost it back to the database
No, you don't want to do that.
:-)
You are introducing a race condition between TWO users who hit the same
page at
update contacts set confirm_number = confirm_number + 1 order by
contact
desc limit 1
Here is the php query I've been using to send the record in the first
place
$query=INSERT INTO contacts (first_name, last_name, email, phn_number,
address, city, state, zip, dates, comments, confirm_number)
[EMAIL PROTECTED] wrote:
update contacts set confirm_number = confirm_number + 1 order by
contact
desc limit 1
Here is the php query I've been using to send the record in the first
place
$query=INSERT INTO contacts (first_name, last_name, email, phn_number,
address, city, state, zip,
On Fri, Nov 14, 2008 at 1:22 PM, [EMAIL PROTECTED] wrote:
update contacts set confirm_number = confirm_number + 1 order by
contact
desc limit 1
Here is the php query I've been using to send the record in the first
place
$query=INSERT INTO contacts (first_name, last_name, email,
Ok, so just that I am clear, you are SELECTing and pulling all the data
that you are submitting in the above INSERT statement from the DB
initially,
then you are only modifying the confirm_number value and then re-
submitting all the values, as they originally were,
Well, actually when all is
[EMAIL PROTECTED] wrote:
Ok, so just that I am clear, you are SELECTing and pulling all the data
that you are submitting in the above INSERT statement from the DB
initially,
then you are only modifying the confirm_number value and then re-
submitting all the values, as they originally were,
Jim Lucas wrote:
[EMAIL PROTECTED] wrote:
Ok, so just that I am clear, you are SELECTing and pulling all the data
that you are submitting in the above INSERT statement from the DB
initially,
then you are only modifying the confirm_number value and then re-
submitting all the values, as
On Fri, 2008-11-14 at 13:31 -0800, Jim Lucas wrote:
'{$Comments}',
@confirm_number
)
The above should be this instead
@confirm_number
);
Even after fixing that, nothing gets inserted into the database. I've
been all
Michael S. Dunsavage wrote:
On Fri, 2008-11-14 at 13:31 -0800, Jim Lucas wrote:
'{$Comments}',
@confirm_number
)
The above should be this instead
@confirm_number
);
Even after fixing that, nothing gets inserted into the
Jim Lucas wrote:
Michael S. Dunsavage wrote:
On Fri, 2008-11-14 at 13:31 -0800, Jim Lucas wrote:
'{$Comments}',
@confirm_number
)
The above should be this instead
@confirm_number
);
Even after fixing that, nothing gets
On Fri, 2008-11-14 at 12:46 -0800, Jim Lucas wrote:
SELECT @confirm_number AS confirm_number;
Are we not SELECTING the column value here? should we be selecting
confirm_number as confirm_number?
--
Michael S. Dunsavage
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe,
If you're just adding one, there is no reason to retrieve the data,
process it, and update it. You can just update the number.
http://dev.mysql.com/doc/refman/5.0/en/update.html
Also, you should read the MySQL manual on default values:
On Fri, 2008-11-14 at 00:52 -0600, Micah Gersten wrote:
If you're just adding one, there is no reason to retrieve the data,
process it, and update it. You can just update the number.
http://dev.mysql.com/doc/refman/5.0/en/update.html
But, the problem is that the confirm_number is a
Michael S. Dunsavage schreef:
okay I want to pull an integer from a database called confirm_number,
add 1 and repost it back to the database
here's the code I'm using.
$queryconfirm=SELECT confirm_number from contacts ORDER BY contact DESC
LIMIT 1;
$confirmresult=$queryconfirm;
Rob Gould schrieb:
Question about mySQL and PHP, when using the mySQL ORDER BY method...
Basically I've got data coming from the database where a wine
producer-name is a word like:
Château Bahans Haut-Brion
or
La Chapelle de La Mission Haut-Brion
or
Le Clarence
Robert Cummings wrote:
On Fri, 2008-10-24 at 00:18 -0400, Rob Gould wrote:
Question about mySQL and PHP, when using the mySQL ORDER BY method...
Basically I've got data coming from the database where a wine
producer-name is a word like:
Château Bahans Haut-Brion
or
At 11:16 PM -0700 10/21/08, Ryan S wrote:
clipp
Am hoping someone out there can recommend a better script or maybe
share some of your own code?
Any help would be appreciated.
Do it right... read up on MySQL's fulltext matching.
Cheers,
Rob.
/clipp
Did some searching based on your tip,
clipp
Am hoping someone out there can recommend a better script or maybe share some
of your own code?
Any help would be appreciated.
Do it right... read up on MySQL's fulltext matching.
Cheers,
Rob.
/clipp
Did some searching based on your tip, got what i was looking for, just didnt
On Tue, 2008-10-21 at 21:48 -0700, Ryan S wrote:
Hey all,
I have two columns in my DB
title varchar(254)
and
jtext text
which I would like to search, as the user might enter two or more words I am
opting not to use LIKE %search_term% so started searching google, I came
across this
On Sat, Oct 18, 2008 at 3:22 AM, Frank Stanovcak
[EMAIL PROTECTED] wrote:
I'm using the following code to try and do a simple insert query. However
it won't insert the data into the table, and I get no error messages. What
have I done wrong this time?
You will be getting an error.
echo
Ross McKay schreef:
Posting this here, because a few people responded when I mentioned not
having a Linux-native data modelling tool. Apparently, MySQL Workbench
should be alpha-ready by end of the month...
http://dev.mysql.com/workbench/?p=138
no news of MacOSX, what's the chance this will
By the way it installed MySQL 6 and PHP 5.0.4 and from the console this
command does not work:
mysql -u root -p
but only this works:
mysql -h hostname -u root -p
I tried doing the same while connecting to the database via php but it
does not work.
Rahul wrote:
I am using Fedora Core 4. As
Hi Jim Lucas,
You are correct... i want to run in the same way.
but as my 2 tables, column name are different i cant run the LOAD DATA
infile.
And the example you mentioned for break at 100, also i thought to use in
that way. but one of the column had the text type which we cant predict
about
Sanjeev N wrote:
Hi Jim Lucas,
You are correct... i want to run in the same way.
but as my 2 tables, column name are different i cant run the LOAD DATA
infile.
If you're inserting the same data, then use LOAD DATA INFILE to load it
into a temporary table, then use INSERT SELECT's to put
Waynn Lue wrote:
Wouldn't using LOAD DATA INFILE be better than writing your own script?
depends, does the data file match the table column for column?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Jim Lucas wrote:
Waynn Lue wrote:
Wouldn't using LOAD DATA INFILE be better than writing your own script?
depends, does the data file match the table column for column?
Doesn't have to.
http://dev.mysql.com/doc/refman/5.0/en/load-data.html
By default, when no column list is provided at
Sanjeev N [EMAIL PROTECTED] wrote:
Hi,
I have written a program which imports the tab delimited file and insert all
the line from file to the mysql line by line.
I am succeding in the above case. but problem with the above method is its
taking to too much time while inserting into the
Sanjeev N wrote:
Hi,
I have written a program which imports the tab delimited file and insert all
the line from file to the mysql line by line.
I am succeding in the above case. but problem with the above method is its
taking to too much time while inserting into the database.
The file's size
Jim Lucas wrote:
Sanjeev N wrote:
Hi,
I have written a program which imports the tab delimited file and
insert all
the line from file to the mysql line by line.
I am succeding in the above case. but problem with the above method is
its
taking to too much time while inserting into the
Wouldn't using LOAD DATA INFILE be better than writing your own script?
On 5/1/08, Jim Lucas [EMAIL PROTECTED] wrote:
Jim Lucas wrote:
Sanjeev N wrote:
Hi,
I have written a program which imports the tab delimited file and
insert all
the line from file to the mysql line by line.
I
On Tue, Mar 25, 2008 at 8:20 AM, Steven Macintyre
[EMAIL PROTECTED] wrote:
I have three tables, namely;
User
- UID
- Firstname
- Surname
- Tel
- Cell
- Email
Tracker
- UID
- Points
Winners
- UID
- Datetime (-00-00 00:00:00)
I need to get the following
Steven Macintyre [EMAIL PROTECTED] wrote:
I have three tables, namely;
User
- UID
- Firstname
- Surname
- Tel
- Cell
- Email
Tracker
- UID
- Points
Winners
- UID
- Datetime (-00-00 00:00:00)
I need to get the following information from the above tables (in my
On Sun, Feb 24, 2008 at 5:00 PM, hE [EMAIL PROTECTED] wrote:
The following program gave the error:
Parse error: parse error in C:\apache\htdocs\mysqltest.php on line 10
Look at this part of the code:
$result = mysql_query($sql);
if ($result == 0)
echo 'bError ' . mysql_errno() . ': '.
On Mon, Feb 25, 2008 at 3:07 PM, Larry Garfield [EMAIL PROTECTED] wrote:
Hi folks. I've an odd issue.
Only fair. You're an odd bird, and we're an odd bunch. ;-P
If I connect to a MySQL DB using ext/mysql, and for whatever reason the
process dies (uncaught exception, fatal error,
On Monday 25 February 2008, Daniel Brown wrote:
On Mon, Feb 25, 2008 at 3:07 PM, Larry Garfield [EMAIL PROTECTED]
wrote:
Hi folks. I've an odd issue.
Only fair. You're an odd bird, and we're an odd bunch. ;-P
If I connect to a MySQL DB using ext/mysql, and for whatever reason the
On Feb 24, 2008, at 1135AM, hE wrote:
hi,
I found an e-book in the net about php and mysql and with its sample
program I am trying to test whether I have mysql working correctly
or not. the following program gives error message. why?
What exactly does the error message say? We can help
The following program gave the error:
Parse error: parse error in C:\apache\htdocs\mysqltest.php on line 10
html
headtitleTest MySQL/title/head
body
!-- mysql_up.php --
?php
$host=”localhost”;
$user=”root”;
$password=””;
mysql_connect($host,$user,$password);
$sql=”show status”;
$result =
On Feb 24, 2008, at 200PM, hE wrote:
The following program gave the error:
Parse error: parse error in C:\apache\htdocs\mysqltest.php on line
10
Did you copy/paste the code? If so maybe the quotation marks are the
fancy smart quotes like MS Office likes to use. Try replacing your
I agree, but they all provide some level of handling just might not be the
'most correct' way of handling it
bastien Subject: RE: [PHP] mysql input From: [EMAIL PROTECTED] To: [EMAIL
PROTECTED] CC: [EMAIL PROTECTED]; php-general@lists.php.net Date: Mon, 18 Feb
2008 23:31:21 -0500 On Mon
On Mon, February 18, 2008 10:05 pm, nihilism machine wrote:
I have a user saving a VARCHAR(255) field in a mysql db which has
single quotes in the text, how can i replace them so that they dont
fuck up my mysql command?
http://php.net/mysql_real_escape_string
Google for SQL injection for
On Mon, February 18, 2008 10:19 pm, Bastien Koert wrote:
mysql_real_escape_string()
Yes.
addslashes()
No, not right for different charsets. See above.
htmlentities()
Completely and wildly inappropriate.
Might as well use a cannon to slice a tomato.
--
Some people have a gift link here.
my only wish was that more people wrote more articles about the proper structure.
You mean like the example on the mysql website?
http://dev.mysql.com/doc/refman/5.0/en/stored-procedures.html
--
Postgresql php tutorials
http://www.designmagick.com/
--
PHP General Mailing List
On Mon, 2008-02-18 at 23:05 -0500, nihilism machine wrote:
I have a user saving a VARCHAR(255) field in a mysql db which has
single quotes in the text, how can i replace them so that they dont
fuck up my mysql command?
mysql_real_escape_string()
Cheers,
Rob.
--
On Mon, 2008-02-18 at 23:19 -0500, Bastien Koert wrote:
mysql_real_escape_string()
addslashes()
htmlentities()
take your pick
That's a bad answer. If he's using MySQL then he SHOULD use
mysql_real_escape_string(). None of the other functions will fully
protect him from malicious input.
mysql_real_escape_string()
addslashes()
htmlentities()
take your pick
bastien
From: [EMAIL PROTECTED] To: php-general@lists.php.net Date: Mon, 18 Feb
2008 23:05:10 -0500 Subject: [PHP] mysql input I have a user saving a
VARCHAR(255) field in a mysql db which has single quotes in the
On Sun, February 10, 2008 11:52 am, Per Jessen wrote:
nihilism machine wrote:
$ret = mysql_result($r, 0);
mysql_free_result($r);
if ($this-auto_slashes) return stripslashes($ret);
else return $ret;
}
what is $ret, an array?
No, it's a mysql result object.
No, it's a single field
At any rate, just seeing this tells me that you've got a real mess on
your hands...
Or you could say, You're going to have some fun cleaning that.
--
Richard Heyes
http://www.websupportsolutions.co.uk
Knowledge Base and Helpdesk software hosted for you - no
installation, no maintenance, new
On Sun, February 10, 2008 12:12 pm, nihilism machine wrote:
public function select_one($sql) {
if ($this-auto_slashes) {
return stripslashes($ret);
If you have to call stripslashes() on data coming FROM MySQL, then you
have really messed up...
You've
On Feb 10, 2008 1:03 PM, Per Jessen [EMAIL PROTECTED] wrote:
Yep, you're right - I read mysql_query where the OP said mysql_result.
Don't feel bad. I did the exact same thing when I was reading
over the post just now.
--
/Dan
Daniel P. Brown
Senior Unix Geek
? while(1) { $me = $mind--;
On Feb 10, 2008 12:52 PM, Per Jessen [EMAIL PROTECTED] wrote:
nihilism machine wrote:
$ret = mysql_result($r, 0);
mysql_free_result($r);
if ($this-auto_slashes) return stripslashes($ret);
else return $ret;
}
what is $ret, an array?
No, it's a mysql result object.
no, its the
nihilism machine wrote:
$ret = mysql_result($r, 0);
mysql_free_result($r);
if ($this-auto_slashes) return stripslashes($ret);
else return $ret;
}
what is $ret, an array?
No, it's a mysql result object.
if so how can i access the individual rows in it?
Look up mysql_fetch_assoc().
201 - 300 of 1710 matches
Mail list logo