Just starting out? Need help? Post your questions and find answers here.
ebelouet
 
Posts: 6
Joined: Mon Apr 08, 2019 9:46 am

mysql

by ebelouet Mon Apr 08, 2019 9:49 am

Hi,

Is it possible to use msql data with spider basic ?

Sincerely
Eric
User avatar
Arbrakaan
 
Posts: 86
Joined: Mon Feb 24, 2014 10:54 pm
Location: Geneva

Re: mysql

by Arbrakaan Mon Apr 08, 2019 10:17 am

Yep, you can communicate with mysql through PHP files on a webserver (With HTTPRequest) ( https://www.spiderbasic.com/documentation/http/index.html)

or you have SQLite (client side database) directly in SpiderBasic ( https://www.spiderbasic.com/documentation/database/index.html )
ebelouet
 
Posts: 6
Joined: Mon Apr 08, 2019 9:46 am

Re: mysql

by ebelouet Mon Apr 08, 2019 10:34 am

Thank you very much for that and we try this in few days
User avatar
Arbrakaan
 
Posts: 86
Joined: Mon Feb 24, 2014 10:54 pm
Location: Geneva

Re: mysql

by Arbrakaan Wed Apr 10, 2019 9:47 am

SpiderBasic code :

Code: Select all
  Procedure HttpGetEvent(Success, Result$, UserData)
    If Success
      Debug Result$
    Else
      Debug "HTTPRequest(): Error"
    EndIf
  EndProcedure
 
  Procedure PostProject(id,name.s)
    params.s = "?&id="+Str(id)+"&name="+name
    HTTPRequest(#PB_HTTP_Post, "PostData.php", params.s, @HttpGetEvent())
  EndProcedure
 
  PostProject(184,"SpiderBasic")


PHP file ( PostData.php ) :

Code: Select all
<?php

   $id = isset($_POST['id']) ? $_POST['id'] : '';
   $name = isset($_POST['name']) ? $_POST['name'] : '';

   var_dump($id);
   var_dump($name);

?>
Return to Coding Questions

Who is online

Users browsing this forum: No registered users and 2 guests