This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

mysql and tcl help please :D

Help for those learning Tcl or writing their own scripts.
Post Reply
w
whittinghamj
Op
Posts: 103
Joined: Sun May 21, 2006 4:50 pm

mysql and tcl help please :D

Post by whittinghamj »

hi guys ok i am writing a mysql search / storage system and need a wee bit of help on this one.

I am going to be searching on EXACT LIKE% and LIKE% in that order. I have the following sql lines that i know work fine

Code: Select all

set countrls [mysqlsel $mysql "SELECT COUNT(*) FROM pre WHERE rls = '$text2'" -list]

set countrls [mysqlsel $mysql "SELECT COUNT(*) FROM pre WHERE rls LIKE '$text2%'" -list]

set countrls [mysqlsel $mysql "SELECT COUNT(*) FROM pre WHERE rls LIKE '%$text2%'" -list]
what i am not sure how to do is run the first one - if nothing found then try the second one, if nothing still move onto the forth one, if still nothing then report nothing found.

i know its to do with "if" and elseif but just not sure of the code - anyone able to help me please.

cheers
User avatar
YooHoo
Owner
Posts: 939
Joined: Thu Feb 13, 2003 10:07 pm
Location: Redwood Coast

Post by YooHoo »

try this link to Johoho's Beginners Guide To Tcl. It has extremely useful information on the basics of tcl.
Post Reply