Newbie question :)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Tsongkie
Forum Newbie
Posts: 13
Joined: Sun Feb 01, 2009 6:51 pm

Newbie question :)

Post by Tsongkie »

Hello everyone, I'm new to php programming. Here's what I'm trying to accomplish:

I have a mysql database which is composed of:
line1
line2
line3
line4
and so on..

What I'm trying to do is get the first line on that database, show it in a page, and delete that line from the database.

Anyone can put me on the right track? Thanks in advance :)
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Newbie question :)

Post by requinix »

I love it when people make up terminology because they don't know the right words.

Use a SELECT query to get the first row in the table, then a DELETE to delete it.

Opinion:
Not many circumstances where you should delete stuff from your database. Use a flag to mark something as [in]active or [un]usable, then select the first row that's active/usable.
Tsongkie
Forum Newbie
Posts: 13
Joined: Sun Feb 01, 2009 6:51 pm

Re: Newbie question :)

Post by Tsongkie »

Kewl thanks :)

Can you post a link that has explanations to this mysql functions? I'm used to windows programming lol. This is quite a change
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Newbie question :)

Post by requinix »

Post Reply