Server Problem (MySQL)
#5

The id field doesn't really serve a purpose in this case. If you want to insert it anyway, then use default as value.
PHP код:
INSERT INTO aliases (idusernameipVALUES (default, '%s''%s'
A tip from my part though: If you add a unique key on the 'username' field, you can use the INSERT .. ON DUPLICATE KEY UPDATE syntax. This saves you the extra select query.

PHP код:
INSERT INTO aliases (idusernameipVALUES (default, '%s''%s'ON DUPLICATE KEY UPDATE ip '%s'
Reply


Messages In This Thread
Server Problem (MySQL) - by Unstoppable - 29.09.2012, 13:24
Re: Server Problem (MySQL) - by Necro[ABK] - 29.09.2012, 14:01
Re: Server Problem (MySQL) - by Unstoppable - 29.09.2012, 14:05
Re: Server Problem (MySQL) - by Necro[ABK] - 29.09.2012, 14:10
Re: Server Problem (MySQL) - by Vince - 29.09.2012, 14:35
Re: Server Problem (MySQL) - by Unstoppable - 29.09.2012, 14:58

Forum Jump:


Users browsing this thread: 1 Guest(s)