Jump to content

Recommended Posts

Posted

Hello, it's me again.
This time I have problem with MySQL plugin.
J55Xt8d.png

Here is my code

#include <MySQL.au3>
#include <Date.au3>
#include <MsgBoxConstants.au3>

$User=""
$Password=""
$Database=""
$Serwer=""
;I guess you guys know, why those variables are empty :)


$Column = _NowDate()

$BazaDanych = _MySQLConnect($User, $Password, $Database, $Serwer)

$Variable1 = InputBox("", "Enter a value: ")

$Query = "UPDATE autoit SET '" & $Column & "' = '" & $Variable1 & "'"

MsgBox(0, "MySQL Query Preview", $Query)

_Query($BazaDanych, $Query)

_MySQLEnd($BazaDanych)

 

  • Moderators
Posted

PanStefan,

Please do not bump your own threads within 24 hours.

Remember this is not a 24/7 support forum - those who answer are only here because they like helping others and have some time to spare.  You just have to wait until someone who knows something about your particular problem, and is willing to help, comes online.  Be patient and someone will answer eventually.


M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted

@PanStefan

You should use COM error handler

use 

ObjEvent()

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

Click in link (function Name) which I mention in my previouse post.
There is an example.

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)

PanStefan,

Check that you have a connection like this

$BazaDanych = _MySQLConnect($User, $Password, $Database, $Serwer)
if @error then exit msgbox(17, 'Connect Error', '@ERROR = ' & @ERROR)

Also,

Do you really have a table with a column name equal to the result of _NowDate()?

Do you really want to update all rows with whatever the user is inputing?

kylomas

edit: What OS do you have?

Edited by kylomas
additional info

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...