Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
extracting data like pulling teeth
Old 07-27-2004, 08:13 AM extracting data like pulling teeth
Novice Talker

Posts: 13
Trades: 0
I have this as a way to check that no duplication occurs on my database:


mysql_connect ('online.ulst.ac.uk', 'ltsn','ics' );
$sql_email_check = mysql_query("SELECT email FROM italics WHERE email='$email'");

$email_check = mysql_num_rows($sql_email_check);

if(($email_check > 0)){
$error12 = '<font face="Tahoma">Please fix the following errors: <br />';
$error2c = 1;
if($email_check > 0){
$email2 = '<font face="Tahoma"><font color="#FF0000"><strong>Your email address has already been used by another member in our database. Please submit a different Email address!<br /><br />';
$email2c = 1;
unset($email);
}
exit(); // exit the script so that we do not create this account!
}



but it's coughing up this instead:

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /web2/ltsn-ics/pub/italics/register.php on line 142
coalduststar is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-27-2004, 10:48 AM
witchblade32's Avatar
Super Talker

Posts: 140
Location: Lititz, PA
Trades: 0
First add and "or die" to your query to make sure that you're successfully connecting to the database

PHP Code:
mysql_query("SELECT email FROM italics WHERE email='$email'") or die(mysql_error()); 
Make sure that the email address is being properly assigned to $email
__________________
When you eliminate all other possibilities, what remains, no matter how improbable, is the answer.
witchblade32 is offline
Reply With Quote
View Public Profile Visit witchblade32's homepage!
 
Old 07-27-2004, 10:57 AM
Novice Talker

Posts: 13
Trades: 0
this probably sounds well stupid but it says "no database selected"

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /web2/ltsn-ics/pub/italics/register.php on line 142

what i'm working with is one table (italics) in a big database called ltsn and i'm targetting the column email for counting- do i have the select query all wrong?

Last edited by coalduststar; 07-27-2004 at 11:00 AM..
coalduststar is offline
Reply With Quote
View Public Profile
 
Old 07-27-2004, 11:48 AM hi
Mooofasa's Avatar
Defies a Status

Posts: 1,611
Name: Michael (mik) Land
Location: England
Trades: 0
Why do people put die?????? You could always try 'exit', it works just as well. DIE DIE DIE. Scary.....lol.



mik
__________________

Please login or register to view this content. Registration is FREE
- Tumblog with thoughts, quotes, links, videos, images and my creations.

Please login or register to view this content. Registration is FREE
- The best free web browser.

Please login or register to view this content. Registration is FREE
- Firefox is now Firefail.
Mooofasa is offline
Reply With Quote
View Public Profile Visit Mooofasa's homepage!
 
Old 07-27-2004, 11:50 AM
Republikin's Avatar
Defies a Status

Posts: 3,189
Trades: 3
Quote:
Originally Posted by coalduststar
this probably sounds well stupid but it says "no database selected"

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /web2/ltsn-ics/pub/italics/register.php on line 142

what i'm working with is one table (italics) in a big database called ltsn and i'm targetting the column email for counting- do i have the select query all wrong?
You connect to the server fine but never use mysql_select_db() to pick which db your going to be using.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Republikin is offline
Reply With Quote
View Public Profile
 
Old 07-27-2004, 11:53 AM
Novice Talker

Posts: 13
Trades: 0
ok here we go the whole thing is working except now it doesn't update the database

so it's all backwards now- what am I doing?!?! or not doing?!
Attached Files
File Type: txt php.txt (5.0 KB, 6 views)
coalduststar is offline
Reply With Quote
View Public Profile
 
Old 07-27-2004, 12:51 PM
Novice Talker

Posts: 13
Trades: 0
by the way- thanks to everyone who's helped me so far- silly mistakes! but this last one's just as annoying- any guesses?
coalduststar is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to extracting data like pulling teeth
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.64971 seconds with 13 queries