To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
PHPBuilder.com  
 

 

Go Back   PHPBuilder.com > Tools > Dreamweaver

Dreamweaver In need of help with Dreamweaver?

Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
Old 10-28-2003, 06:31 PM   #1
Hamsterpants
Member
 
Join Date: Mar 2003
Posts: 77
Checking to see if variable exists before insert

Hi All,

I have a set up a customer registration form and all is working fine. I am useing the email address as the users log in name, whcih I check to see if it is unique in the database before I add it. I have a second table called newsletter, where, if the user has selected to receive our newsletter, I would like to add. The reason I have a second table is because I would like to offer users who don't want to register all the details as a customer, to register just their name and email address. The problem I am having is checking to see if the email address exist in the table bofore I insert. Does anyone know of a dream wever extention that can do this or can any one suggest how I do about this.

I know in theory what I need to do, but I cant seem to get it to work.

Any help would be appreciated.

Thanks
Dill
Hamsterpants is offline   Reply With Quote
Old 10-28-2003, 11:07 PM   #2
TheIceman5
Senior Member
 
Join Date: Jun 2003
Posts: 392
its called php, code a query, dunno if manual coding is foreign to you, u seem to be relying on dreamweaver, ive never used dreamweaver for php coding, i always do manually, lot easier.
TheIceman5 is offline   Reply With Quote
Old 10-30-2003, 08:26 AM   #3
olaf
Senior Member
 
olaf's Avatar
 
Join Date: Jun 2003
Location: Netherlands
Posts: 585
just
PHP Code:
$check = "SELECT * FROM table WHERE mail= '$mail'";
$checkResult = mysql_query($check);
$checkRows = mysql_num_rows($checkResult);
if ((isset(
$checkRows)) && ($checkRows == 0))
{
// begin insert record
}
by the way dreamweaver is a very comfortable php-code editor.
__________________
Later!
Olaf

Dutch PHP resource|Web Development Blog
olaf is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 Off
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 05:27 AM.






Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.