Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hello,

 

I have an insert query that works on mysql and another delete statement that doesn't seem to work when executing on mysql.....

 

the problem is with the datetime I think.....

 

this works:

    sql = "insert into tblchat (tijd, tekst, naam) values (str_to_date('" & now & "','%d/%m/%Y %H:%i:%s'),'" & gesplitst(0) & "','" & gesplitst(1) & "')" 

this doesn't work:

    sql = "delete * from tblchat where tijd < STR_TO_DATE('" & dateadd("s",-5,now) & "','%d/%m/%Y %H:%i:%s') "

I don't understand why...Is the delete statement wrong syntax????

 

greets,

 

Inter

 

EDIT: this code did work on an access database but instead of STR_TO_DATE I used cdate.

Posted

Hi,

when my SQL don't work as I was hoping for when building the string I always prints the resulting string (ie sql), copies it to an open GUI of the database where I run the query.

It has two advantages,

1. when the sql is printed you can clearly see what's supposed to happen and solve many problems there

2. The database GUI gives you additional information about the query (I know you can print mysql_error in your app, but somehow it's more obvious in the GUI)

 

HTH

/Kejpa

Posted
what is the best free GUI for mysql anyway ?

Best I'm not sure of but I like SQLYog alot. Check out Webyog home page

mySQL Ab is providing a free tool MySQLCC (MySQL Control Center) which I have installed but not used very much.

 

/Kejpa

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...