Skip to Content
It is currently March 19th, 2019, 11:30 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: March 4th, 2019, 6:16 pm 
Offline
Junior User
Junior User

Joined: September 7th, 2018, 9:00 am
Posts: 51
Hi all,

I'm wondering if PAL is able to write directly into the database, creating tables and records, not only to read from it.

I'm referring to the post here viewtopic.php?f=20&t=55580 where I published my algorithm (which is working fine ever since on the Station).
On that post, I put data into files.

But it's more elegant to use the database.I would like to create just a table with 4 fields: ID, Broadcast name, episondeN, TimesOnAir

and to update the record time by time and reading it.

Is that possible?

thanks a million in advance


Top
 Profile  
Reply with quote  
PostPosted: March 5th, 2019, 4:25 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7773
Location: Aachen (Germany)
Sure: Open the PAL Scripting Reference from the help menu in SAM and check out both Query and ExecSQL methods.
You should use ExecSQL for all INSERT, UPDATE, REPLACE, CREATE, ALTER, DELETE and probably a few more that I can't tell from the top of my head.
Basically all SQL statements that don't return data should use ExecSQL, while all that do should use Query instead.
Other than that, what you can do to the database is only limited by the permissions your user has and the database system.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: March 5th, 2019, 7:18 am 
Offline
Junior User
Junior User

Joined: September 7th, 2018, 9:00 am
Posts: 51
Mastacheata wrote:
Sure: Open the PAL Scripting Reference from the help menu in SAM and check out both Query and ExecSQL methods.
You should use ExecSQL for all INSERT, UPDATE, REPLACE, CREATE, ALTER, DELETE and probably a few more that I can't tell from the top of my head.
Basically all SQL statements that don't return data should use ExecSQL, while all that do should use Query instead.
Other than that, what you can do to the database is only limited by the permissions your user has and the database system.


Fantastic!
This enables tones of possibilities.
In the principle, thus, I can create a table if not exist, and use records as I wished for my script but also for tones of other stuff.
Much more elegant
Much more effective
Thanks a million


Top
 Profile  
Reply with quote  
PostPosted: March 5th, 2019, 7:37 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7773
Location: Aachen (Germany)
Check out the PAL Quick Start Guide and once you're done with that randomly click a few items in the PAL scripting guide for a few minutes to learn a lot more about what PAL can do for you :P

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group