PHP Classes

Question about arrays

Recommend this page to a friend!

      Mind  >  All threads  >  Question about arrays  >  (Un) Subscribe thread alerts  
Subject:Question about arrays
Summary:Array order in createtable function
Author:Carlos Garcia
Date:2018-12-06 00:01:59

  1. Question about arrays   Reply   Report abuse  
Carlos Garcia - 2018-12-06 00:01:59
Thanks a lot for sharing this package, I just have a doubt, I tried to create a table with the public function createtable, I see it requires 2 variables, the table name and the array, It works fine, but the table created looks like every row is a TEXT type, and I need them to be INT. I tried using ':' between values but didn't work, can you tell me and example for this array?

$arr = array ('t1','t2','t3','t4'); // works for text type
$arr = array ('t1:INT','t2;INT','t3:INT','t4:INT'); // didn't work and the following error appears:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';INT TEXT NULL)' at line 1'

Hope you can help me, as you can imagine I'm newbie in php.