|
Posted by jay2006 on 12/21/06 07:17
I added:
$s=SELECT C_USER_NAME FROM CUSTOMER where C_USER_NAME = '$cus[8]'";
$sql = mysql_query($s, $link);
Then tried to register and got the following error:
Parse error: syntax error, unexpected T_STRING in
/home/squirt/public_html/mature/files/insert.php on line 116
jay2006 wrote:
> Oops, sorry, I thought to just add the error parts. I'll give what you
> said a go and will let you know how it goes.
>
> Thanks
>
>
>
> Geoff Berrow wrote:
> > Message-ID: <1166682191.046574.280090@f1g2000cwa.googlegroups.com> from
> > jay2006 contained the following:
> >
> > >Warning: mysql_num_rows(): supplied argument is not a valid MySQL
> > >result resource in /insert.php on line 117
> >
> > Your query is failing
> > >
> > >Warning: Cannot modify header information - headers already sent by
> > >(output started at /insert.php:117)
> > >in /insert.php on line 128
> > >
> > >Warning: Cannot modify header information - headers already sent by
> > >(output started at /insert.php:117)
> > >in /insert.php on line 129
> >
> > These are created because php has echoed a warning before your header
> > call
> > >
> > >
> > > if($num3 != 0)
> > > {
> > > $msg = ("<b>Email Already Registered:</b><br>We are sorry but the
> > >email you have entered has already been registered, please use another
> > >or try to recover your previous account.");
> > > mysql_close($link);
> > > }
> > > else
> > > {
> > > $sql = mysql_query("SELECT C_USER_NAME FROM CUSTOMER where
> > >C_USER_NAME = '$cus[8]'", $link);
> > >line 117>>> $num = mysql_num_rows($sql);
> >
> >
> > Do this:
> > $s=SELECT C_USER_NAME FROM CUSTOMER where C_USER_NAME = '$cus[8]'";
> > $sql = mysql_query($s, $link);
> >
> > That way your can debug the SQL statement by doing
> > echo $s;
> >
> > Also you can do this which gives you more info
> > $sql = mysql_query($s, $link) or die(mysql_error());
> >
> > You haven't shown your database connection section. Is that ok, did you
> > remember to include it?
> >
> >
> > --
> > Geoff Berrow 0110001001101100010000000110
> > 001101101011011001000110111101100111001011
> > 100110001101101111001011100111010101101011
Navigation:
[Reply to this message]
|