[PHP] suppressing errors
Hello All, I am trying to use the "@" symbol to suppress errors returned by a mysql_query call. This doesn't seem to be working as I get an new page with the error in it in my browser. Any help with this would be greatly appreciated. Here is a snippet of the code I am using $query = "select user_id from users where username='$username'"; $query_db = @mysql_query($query, $db_connection); $row = @mysql_fetch_array($query_db); if($row) { $message[] = "That username is already taken. Please select another."; } else { Thanks, Preston -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] suppressing errors
The error is one from mysql stating that I am trying to add a duplicate entry. I would rather handle this in my code hence the following lines in my code. if($row) { $message[] = "That username is already taken. Please select another."; } else { Thanks for the response. Thanks, Preston > -Original Message- > From: "1LT John W. Holmes" <[EMAIL PROTECTED]>@INTERNET@HHC > Sent: Thursday, July 25, 2002 2:53 PM > To: Preston Wade; [EMAIL PROTECTED] > Subject: Re: [PHP] suppressing errors > > What is the error you get? > > ---John Holmes... > > - Original Message - > From: "Preston Wade" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Thursday, July 25, 2002 3:20 PM > Subject: [PHP] suppressing errors > > > > Hello All, > > > > I am trying to use the "@" symbol to suppress errors returned by a > > mysql_query call. This doesn't seem to be working as I get an new page > with > > the error in it in my browser. Any help with this would be greatly > > appreciated. > > > > Here is a snippet of the code I am using > > > > $query = "select user_id from users where username='$username'"; > > $query_db = @mysql_query($query, $db_connection); > > $row = @mysql_fetch_array($query_db); > > if($row) { > > $message[] = "That username is already taken. Please select > > another."; > > } else { > > > > Thanks, > > Preston > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] isset
Hello All, I am trying to use the isset function to test if the page has been submitted, but it seems as though it is not working. I am wondering is there a configuration option that is messing with the functionality of isset. Any help would be appreciated. Thanks, Preston Wade -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] isset
HTML form. register_globals is off. Thanks, Preston > -Original Message- > From: "Jim lucas" <[EMAIL PROTECTED]>@INTERNET@HHC > Sent: Tuesday, July 09, 2002 5:29 PM > To: Preston Wade; [EMAIL PROTECTED] > Subject: Re: [PHP] isset > > <<...>> > what is it you are testing for? > > a page that has been submitted. do you mean from an html form or some > other > method? > > Jim Lucas > - Original Message - > From: "Preston Wade" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, July 09, 2002 3:20 PM > Subject: [PHP] isset > > > > Hello All, > > > > I am trying to use the isset function to test if the page has been > > submitted, but it seems as though it is not working. I am wondering is > > there a configuration option that is messing with the functionality of > > isset. > > > > Any help would be appreciated. > > > > Thanks, > > Preston Wade > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: isset
Actually here is what I am trying to do. blah, blah > -Original Message- > From: vins <[EMAIL PROTECTED]>@INTERNET@HHC > Sent: Tuesday, July 09, 2002 5:35 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Re: isset > > i think what you're trying to do is > > if($REQUEST_METHOD == "POST") > { > echo "Form has been submitted."; > exit; > } > else > { > echo "Display the form that has to be submitted.': > exit; > } > ?> > > > "Preston Wade" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > Hello All, > > > > I am trying to use the isset function to test if the page has been > > submitted, but it seems as though it is not working. I am wondering is > > there a configuration option that is messing with the functionality of > > isset. > > > > Any help would be appreciated. > > > > Thanks, > > Preston Wade > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] isset
This is what I was looking for. Thanks! Preston > -Original Message- > From: "Kevin Stone" <[EMAIL PROTECTED]>@INTERNET@HHC > Sent: Tuesday, July 09, 2002 5:37 PM > To: Preston Wade; [EMAIL PROTECTED] > Subject: Re: [PHP] isset > > <<...>> > > > > > if (isset($_POST['submit'])){} > // or // > if (isset($HTTP_POST_VARS['submit'])) > > If register globals is ON you can access the variable directly.. > if (isset($submit)) {} > > Otherwise you can extract the post array before testing the variable.. > extract($_POST); > if (isset($submit)) {} > > Hope this gets you started. Read up on the manual. http://www.php.net. > :) > -Kevin > > > - Original Message - > From: "Preston Wade" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, July 09, 2002 4:20 PM > Subject: [PHP] isset > > > > Hello All, > > > > I am trying to use the isset function to test if the page has been > > submitted, but it seems as though it is not working. I am wondering is > > there a configuration option that is messing with the functionality of > > isset. > > > > Any help would be appreciated. > > > > Thanks, > > Preston Wade > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] multiple select list
Hello All, I have seen what I am trying to do on other web sites, but they were written in client side scripting languages. This may or may not be a limitation of server side scripting languages. What I am trying to do is dynamically generate 2 drop down list. I want the second list to contain different values based on what people choose in the first drop down list. If someone could guide me to some documentation on how to accomplish this it would be greatly appreciated. Thanks, Preston -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php