Re: Re: or die problem
| From: | Cristian MARIN | Date: | Sat, 28 Jun 2003 02:33:40 +0000 |
| Subject: | Re: Re: or die problem | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-20604@lists.php.net to get a copy of this message | ||
Try echo mysql_query($your_query_here), because if returns false it will
die.
To figure out why it return false see how many_rows were affected with
mysql_affected_rows();
--
-------------------------------------------------
Cristian MARIN - Developer
InterAKT Online (www.interakt.ro)
Tel: +4021 312.53.12
Tel/Fax: +4021 312.51.91
cristic@interakt.ro
"Dan Croskerry" <dcrosker@hpl.ca> wrote in message
news:944AF5792FE8D411A7810002A5070498084172C8@corvus.hamilton.ca...
> There is no error message. It happens mostly when I am doing an update or
> insert statement. There is no problem with the sql because the data gets
> written to the db. If I use or die it still writes to the db but the or
die
> kills the processing. It's strange.
>
> -----Original Message-----
> From: Cristian MARIN [mailto:cristic@iakt.rdsnet.ro]
> Sent: Friday, June 27, 2003 10:18 PM
> To: php-windows@lists.php.net
> Subject: [PHP-WIN] Re: or die problem
>
>
> Maybe not the query is the problem, maybe the connection or the
> authentication ... Try executing the sql without the die part and then
print
> out the
> mysql_error() if the mysql_errno()!=0
>
> mysql_query($your_query_here);
> if (mysql_errno()!=0){
> die (mysql_error());
> }
>
>
> --
> -------------------------------------------------
> Cristian MARIN - Developer
> InterAKT Online (www.interakt.ro)
> Tel: +4021 312.53.12
> Tel/Fax: +4021 312.51.91
> cristic@interakt.ro
> "Dan Croskerry" <dcrosker@hpl.ca> wrote in message
> news:944AF5792FE8D411A7810002A5070498084172C7@corvus.hamilton.ca...
> > I'm new to the windows platform for php development and I have been
> > having problems with the or die function when running sql queries. It
> > is being called even when I run a valid query. I have tested it with
> > valid queries and it is always triggered. I have had to stop using it
> > which is not good.
> I
> > never had problems with or die when I was working in a linux
> > environment.
> >
> > Does anyone know if there is a setting in the php.ini file that I have
> > to set for or die to work? My DB is MS SQL 2000.
> >
> > Thanks in advance,
> > Dan
> >
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>