Author Topic: Need Help to Understand Code  (Read 5052 times)

0 Members and 1 Guest are viewing this topic.

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: Need Help to Understand Code
« Reply #15 on: February 10, 2019, 10:16:20 pm »
I'm in my 60s and now I do comment, spell out descriptive variable names, and indent. I really miss the "old" days... when I wasn't so damn old!

Mt database stuff was probably around 50,000 records, so we are miles apart in this area. You may want to start up a discussion with Steve, just on managing techniques. I don't think he has worked with MySQL, but he has worked on some commercial billion record systems.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Need Help to Understand Code
« Reply #16 on: February 10, 2019, 11:14:20 pm »
MySQL experience is effectively zip with regards to trying to use it with QB64.  The only times I’ve ever had to work with SQL was for localized database access, so I’ve never needed to sort out online query information/protocols and such.  Much of my database work (when I was getting paid to do it), was written back in the day with DBASE IV or FoxPro 2.0 (and higher), and I’ve even written converters for DBF files so we can use them easily in QB64.  https://www.qb64.org/forum/index.php?topic=64.msg303#msg303

Unfortunately, those aren’t what you’re looking for here, so I’ve been mostly silent on this subject, hoping someone with more SQL/QB64 integration experience could help answer your questions.  ;)
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: Need Help to Understand Code
« Reply #17 on: February 11, 2019, 08:25:23 am »
Hi
on first I attach the files to work with MySQL  but I got little fortune and bad results...for my actual knowledge of mySQL I think

on second you must correct the code in the example in Wiki...
I'm expert about eating letters on typing so IMHO in the last row before END of the first example there is an "n" less than it should be

Quote
mysql_close con

in the example you can see that it is DIMmed conn and not con  [ You are not allowed to view this attachment ]  
Programming isn't difficult, only it's  consuming time and coffee

Offline MLambert

  • Forum Regular
  • Posts: 115
    • View Profile
Re: Need Help to Understand Code
« Reply #18 on: February 11, 2019, 09:15:10 pm »
Hi All,

I have been working thru' mysql in wiki and found that it is a very strong piece of code.

It is very hard to read .. but plodding my way thru'.

I have been able to use it ... but at the moment I am checking error return code e.g. select a unique key ... what error return if not found.

I have had help from Fellippe and Juanjogomez

If anyone wants some detail on how to use it just let me know.

When I am finished I will post all of the code in this forum.

By the way I did not know mysql until I started this work ... it is pretty simple and logical. For the clever bits just google.

Mike
« Last Edit: February 11, 2019, 09:17:39 pm by MLambert »

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: Need Help to Understand Code
« Reply #19 on: February 17, 2019, 12:50:13 pm »
It will be fantastic if in wiki the link mysql.dll was working!
But I have no original file attached to that link, only my downloaded version libmysql.dll from SQL website!

Long life to QB64! And to its contributors...
Programming isn't difficult, only it's  consuming time and coffee

Offline Juanjogomez

  • Forum Regular
  • Posts: 117
    • View Profile
Re: Need Help to Understand Code
« Reply #20 on: February 17, 2019, 02:43:24 pm »

Hi,
I do not use the error codes.
When you search for a data using a SELECT, the program returns the data in an array of rows or columns. If the rows are 0, you have not found any data. It's the first thing I check every time I do a search.
Regards

Offline MLambert

  • Forum Regular
  • Posts: 115
    • View Profile
Re: Need Help to Understand Code
« Reply #21 on: March 28, 2019, 07:12:11 pm »
Hi  Juanjogomez

 When you check for errors ... would you pls show me your code..

Mike