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.

The Database Forum


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



Reply
Old 09-21-2006, 12:39 PM delete sql record
atomicshockwave's Avatar
Experienced Talker

Posts: 38
Trades: 0
hi i have a php script that pulls data from a sql database,
each time it querys the database it pulls 1 entry from each of the 3 fields.

how can I delet just the one set of records?

I tryed using

PHP Code:
$delete DELETE FROM `$username`
WHERE id='4'
however, this requiers me to state the id to be deleated, but i need it to just deleate whatever information was just pulled.

please help!!!!!!!!
atomicshockwave is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-21-2006, 03:01 PM Re: delete sql record
Novice Talker

Posts: 8
Trades: 0
Quote:
Originally Posted by atomicshockwave View Post
hi i have a php script that pulls data from a sql database,
each time it querys the database it pulls 1 entry from each of the 3 fields.

how can I delet just the one set of records?

I tryed using

PHP Code:
$delete DELETE FROM `$username`
WHERE id='4'
however, this requiers me to state the id to be deleated, but i need it to just deleate whatever information was just pulled.

please help!!!!!!!!
What is the name of the table? First of all you dont have quotes around your statement. But here is what i how i would do.
PHP Code:
$result=mysql_query("DELETE FROM `username` WHERE `id`='4'"); 
rjbrock is offline
Reply With Quote
View Public Profile
 
Old 09-23-2006, 02:45 PM Re: delete sql record
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
If ID is numeric you should NOT have single quotes around it
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to delete sql record
 

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.17981 seconds with 12 queries