Re: [PHP4BETA] Help with mysql+php script
| From: | David Robley | Date: | Tue, 07 Dec 1999 04:00:01 +0000 |
| Subject: | Re: [PHP4BETA] Help with mysql+php script | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-7574@lists.php.net to get a copy of this message | ||
On 6 Dec, Matt Greene wrote:
> Ok I need some major help, i dont understand what is going wrong. in a part
What _is_ going wrong? Nothing being deleted?
> of a script i need to delete a row in a mysql table, so here is what i am
> using
>
> function dropData()
>
> global $mysqlHandle, $dbname, $tablename, $fieldname, $PHP_SELF;
>
> mysql_select_db( $dbname, $mysqlHandle );
> mysql_query( "DELETE FROM $tablename WHERE $fieldname = $deldata" ,
> $mysqlHandle );
> }
First thought here: if $fieldname is a character field the value
$deldata needs to be enclosed in single quotes. If that isn't the
problem, try using mysql_error() after the mysql_query to see if MySQL
is returning a useful error message.
Cheers
--
David Robley
WEBMASTER | Phone +61 8 8374 0970
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA
Visit the PHP mirror at http://au.php.net:81/
<<<<<<<<<<<<< WARNING * END OF TEXT * STOP READING HERE
>>>>>>>>>>>>>>