TechSpott - Computer and technology forums

Go Back   TechSpott - Computer and technology forums > Webmasters > Database Management > MySQL
MySQL Forum dedicated to the world's most popular open source database engine.

Reply
 
Thread Tools Display Modes
Old April 26th, 2010, 12:13 AM   #1 (permalink)
Captain Obvious
Guest
 
Posts: n/a
Default MySQL select and insert help?

Trying to do something like this:

$result = mysql_query("INSERT INTO experiments (ip, timestamp) VALUES ('$ip', '$time') WHERE NOT EXISTS (SELECT * FROM experiments WHERE ip = '$ip'");

(get all the ip from experiments if none of the ip match $ip run the insert)
I could do it with multiple queries but i'd rather do it in one if possible... I have no idea what i'm doing though.
  Reply With Quote Share with Facebook
Reply

Bookmarks

Tags
insert, mysql, select


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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL Insert Query Issue? 24JJ24 MySQL 0 April 16th, 2010 11:16 PM
MySQL Insert Query Issue? 24JJ24 MySQL 0 April 16th, 2010 11:16 PM

 
Forum Stats
Members: 14,322
Threads: 20,329
Posts: 27,676
Total Online: 33

Newest Member: noupenusetell

Latest Threads

Advertisements

Support our advertisers!

Amazon
Sears
Macys
1800flowers.com
Drugstore.com


Carbonite Online-Backups
Tiger Direct
Tech Depot
Buy.com
Office Depot
Fatcow
HostGator


TripsNow.us
Marriott
Expedia
CheapTickets.com
OneTravel
Hotwire

Are you a Fan?

Share this on Facebook

Tag Cloud

Partner Links


Contact Us - Home - Archive - Privacy Statement - Top - Copyright © 2009-2010, TechSpott - All times are GMT -4. Time is 05:44 AM

Powered by vBulletin® Copyright © Jelsoft Enterprises Ltd. :: SEO by vBSEO