Login pages... (quickie)
Moderator: General Moderators
-
Mightywayne
- Forum Contributor
- Posts: 237
- Joined: Sat Dec 09, 2006 6:46 am
Right see okay, I just said I have no idea how to use it. >_____> Every time I use it, including errno(), it just gives me that error. That apparently means something is wrong with connecting, so I'm going to start from a scratch, a form, using cookies. Also apparently, this is not as hard as it seems to be for me. Quoth my friends.
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
This is how you use it.
Code: Select all
$result = mysql_query('some query');
if (!$result) {
trigger_error(mysql_error());
}What does that mean?>_____>
-
Mightywayne
- Forum Contributor
- Posts: 237
- Joined: Sat Dec 09, 2006 6:46 am

It's a face. It's meant to show, like, difficulty or frustration with something.
Small edit: Plox.. it doesn't work in this forum?
I'm going to try to mess around with that mysql_error thing now that you've showed me, and let's see if I can figure it out. (I'll edit my post if so... if not, this is the end, I do believe, of sessions for mii)
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
How are sessions responsible for your problems with failing queries? Sessions are cool but I fail to see how they are releventif not, this is the end, I do believe, of sessions for mii
Right OK, I prefer: >_<It's a face. It's meant to show, like, difficulty or frustration with something.
Last edited by Ollie Saunders on Thu Jan 18, 2007 6:05 pm, edited 1 time in total.
-
Mightywayne
- Forum Contributor
- Posts: 237
- Joined: Sat Dec 09, 2006 6:46 am
Editted out in case some folks try to hax0r me. Seriously. o_O;;
Last edited by Mightywayne on Fri Apr 06, 2007 2:21 pm, edited 1 time in total.
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
-
Mightywayne
- Forum Contributor
- Posts: 237
- Joined: Sat Dec 09, 2006 6:46 am
- aaronhall
- DevNet Resident
- Posts: 1040
- Joined: Tue Aug 13, 2002 5:10 pm
- Location: Back in Phoenix, missing the microbrews
- Contact:
Are you sure that there aren't any misspellings? Remember that table and column names are case-sensitive on unix systems. It also wouldn't hurt to enclose the column name in back-ticks (`).
Anyway, it doesn't sound like your friend knows a whole lot about sessions either -- they'll save you a lot of time in the long run. To each his own, I guess.
Anyway, it doesn't sound like your friend knows a whole lot about sessions either -- they'll save you a lot of time in the long run. To each his own, I guess.
-
Mightywayne
- Forum Contributor
- Posts: 237
- Joined: Sat Dec 09, 2006 6:46 am
Editted out in case some folks try to hax0r me. Seriously. o_O;;
Last edited by Mightywayne on Fri Apr 06, 2007 2:22 pm, edited 1 time in total.
-
Mightywayne
- Forum Contributor
- Posts: 237
- Joined: Sat Dec 09, 2006 6:46 am
- aaronhall
- DevNet Resident
- Posts: 1040
- Joined: Tue Aug 13, 2002 5:10 pm
- Location: Back in Phoenix, missing the microbrews
- Contact:
If you make reference to an array key that's not set, e.g. $myArray['thisWasNeverSet'], then you'll get a notice. You need to check it with isset() before referencing it.
Code: Select all
$array = array('hello' => '1');
echo $array['hello']; // no notice
echo $array['world']; // notice is issued
if(isset($array['world'])) { echo $array['world']; } // no notice-
Mightywayne
- Forum Contributor
- Posts: 237
- Joined: Sat Dec 09, 2006 6:46 am
- aaronhall
- DevNet Resident
- Posts: 1040
- Joined: Tue Aug 13, 2002 5:10 pm
- Location: Back in Phoenix, missing the microbrews
- Contact:
I'm sorry -- it's actually any variable or array key. Anyway, what are the lines that the notices are referring to?
Here's how to use mysql_error() for future reference:
Here's how to use mysql_error() for future reference:
Code: Select all
$res = mysql_query('SELECT ...') or die('MySQL Error: ' . mysql_error());