Link to home
Start Free TrialLog in
Avatar of rgb192
rgb192Flag for United States of America

asked on

if $new_input is empty do not update

using php to update $new_input to varchar column

if $new_input is empty do not update


this has to be writen in mysql not php
SOLUTION
Avatar of Lukasz Chmielewski
Lukasz Chmielewski
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rgb192

ASKER

I understand length
SELECT LENGTH('text');
http://dev.mysql.com/doc/refman/5.1/en/string-functions.html#function_length


but do not understand how to do conditional statement


the if in php would be too complex
I would rather do in mysql so I can test in query editor
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rgb192

ASKER

the former introduced length and the latter applied length and a conditional statement to a sample query. Thank you.