SitePoint Sponsor |
|
User Tag List
Results 1 to 7 of 7
Thread: Checking the database.....?
Hybrid View
-
Sep 18, 2000, 15:48 #1
- Join Date
- Aug 2000
- Location
- Houston, TX, USA
- Posts
- 6,455
- Mentioned
- 11 Post(s)
- Tagged
- 0 Thread(s)
Hi,
Can anyone post some code on how to test the database to see if the information that was just entered was already in the database? Could you also post an explanation?
Thanks,
ssegraves [at] gmail.com
On Image Use, Abuse, and Where We're Headed
stephan | XMLHttpRequest Basics
flickr | last.fm | Cogentas, LLC
-
Sep 18, 2000, 17:06 #2
- Join Date
- Aug 2000
- Location
- Houston, TX, USA
- Posts
- 6,455
- Mentioned
- 11 Post(s)
- Tagged
- 0 Thread(s)
Ohh forgot what language... I would like to use PHP.. Many thanks,
ssegraves [at] gmail.com
On Image Use, Abuse, and Where We're Headed
stephan | XMLHttpRequest Basics
flickr | last.fm | Cogentas, LLC
-
Sep 18, 2000, 21:27 #3
- Join Date
- Aug 1999
- Location
- Pittsburgh, PA, USA
- Posts
- 3,910
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You'd have to be more specific - would all fields need to be the same, or just one? Would you be using a MySQL database?
-
Sep 19, 2000, 07:28 #4
- Join Date
- Aug 2000
- Location
- Houston, TX, USA
- Posts
- 6,455
- Mentioned
- 11 Post(s)
- Tagged
- 0 Thread(s)
Yes I am going to be using MySQL.... There are two fields that need to be checked... "Name" and "E-mail".
Sincerely,ssegraves [at] gmail.com
On Image Use, Abuse, and Where We're Headed
stephan | XMLHttpRequest Basics
flickr | last.fm | Cogentas, LLC
-
Sep 19, 2000, 07:34 #5
- Join Date
- Aug 1999
- Location
- Pittsburgh, PA, USA
- Posts
- 3,910
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Try a query like this:
SELECT * FROM dbname WHERE Name='$theName' AND Email='$theEmail'
Once you've selected the record, use an if statement:
if ($Name == "$theName" && $Email == "$theEmail") {do stuff}
I think that ought to work, at least
-
Sep 19, 2000, 07:59 #6
- Join Date
- Aug 2000
- Location
- Houston, TX, USA
- Posts
- 6,455
- Mentioned
- 11 Post(s)
- Tagged
- 0 Thread(s)
I'll try it
Many thanks!ssegraves [at] gmail.com
On Image Use, Abuse, and Where We're Headed
stephan | XMLHttpRequest Basics
flickr | last.fm | Cogentas, LLC
-
Sep 19, 2000, 08:13 #7
- Join Date
- Aug 1999
- Location
- Pittsburgh, PA, USA
- Posts
- 3,910
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Don't thank me - odds are there are at least fifty other ways to achieve the same thing...all more efficient than mine.
And thats assuming it works.
Bookmarks