Re: [PHP-DB] if() and else() help needed

2006-03-28 Thread David Robley
JeRRy wrote: > > > Well the way I have it over 2 PHP calls works, as 'nickname' is a UNIQUE > key entry in the db. So multiple entries are not an issue. So if it > can't insert, as it will try and fail it will update. > > But if the insert works I am guessing it's going to do a

Re: [PHP-DB] if() and else() help needed

2006-03-28 Thread JeRRy
Well the way I have it over 2 PHP calls works, as 'nickname' is a UNIQUE key entry in the db. So multiple entries are not an issue. So if it can't insert, as it will try and fail it will update. But if the insert works I am guessing it's going to do an update straight after it

Re: [PHP-DB] if() and else() help needed

2006-03-27 Thread Chris
JeRRy wrote: Hi, Yes the user is logged in. The system knows who is tipping by their nickname and unique id system. So if I put the update query in the else statement would this be the easy fix? Don't know - I was offering a suggestion only. Without the full code we can't really help m

Re: [PHP-DB] if() and else() help needed

2006-03-27 Thread JeRRy
Hi, Yes the user is logged in. The system knows who is tipping by their nickname and unique id system. So if I put the update query in the else statement would this be the easy fix? I use something like a field called tipped in the table, so if they have tipped it goes to y a

Re: [PHP-DB] if() and else() help needed

2006-03-27 Thread Chris
JeRRy wrote: Hi, I'll admit it, this is damned messy. But I want to learn from the list in how to sort it out. Than for future refrence I will know... Now I am running 2 different queries/statements here completely seperate. I have made the "nickname" field in the database UNIQUE.

[PHP-DB] if() and else() help needed

2006-03-27 Thread JeRRy
Hi, I'll admit it, this is damned messy. But I want to learn from the list in how to sort it out. Than for future refrence I will know... Now I am running 2 different queries/statements here completely seperate. I have made the "nickname" field in the database UNIQUE. So than when