MilosT Posted March 6, 2017 Report Share Posted March 6, 2017 Hi, I created table with name USERS. Inside I have defined 3 items : NAME, PASSWORD, EMAIL Is it possible to add record to this table by some script? When I do it locally, I'm using script like this : <?php //Variables for the connection $servername = "localhost"; $s_username = "root"; $s_password = "abcdef"; $my_Table = "USERS"; //Variable from the user $NAME = "JOHN"; $PASSWORD = "abc"; $EMAIL = "john@john.com"; //Make Connection $conn = new mysqli($servername, $s_username, $s_password, $my_Table); //Check Connection if (!$conn) die("Failed. ". mysqli_connect_error()); $sql = "INSERT INTO users (NAME, PASSWORD, EMAIL) VALUES ('".$NAME."','".$PASSWORD."','".$EMAIL."')"; $result = mysqli_query($conn ,$sql); if(!result) echo "error"; else echo "ok."; ?> Is it possible to upload PHP like this to caspio server? Into which directory? What about my_Table name ? What is correct filename, I mean web address for browser. Thank You in advance for any help. Regards, Milos. Quote Link to comment Share on other sites More sharing options...
Mathilda Posted March 7, 2017 Report Share Posted March 7, 2017 On 3/6/2017 at 5:33 PM, MilosT said: Hi, I created table with name USERS. Inside I have defined 3 items : NAME, PASSWORD, EMAIL Is it possible to add record to this table by some script? When I do it locally, I'm using script like this : <?php //Variables for the connection $servername = "localhost"; $s_username = "root"; $s_password = "abcdef"; $my_Table = "USERS"; //Variable from the user $NAME = "JOHN"; $PASSWORD = "abc"; $EMAIL = "john@john.com"; //Make Connection $conn = new mysqli($servername, $s_username, $s_password, $my_Table); //Check Connection if (!$conn) die("Failed. ". mysqli_connect_error()); $sql = "INSERT INTO users (NAME, PASSWORD, EMAIL) VALUES ('".$NAME."','".$PASSWORD."','".$EMAIL."')"; $result = mysqli_query($conn ,$sql); if(!result) echo "error"; else echo "ok."; ?> Is it possible to upload PHP like this to caspio server? Into which directory? What about my_Table name ? What is correct filename, I mean web address for browser. Thank You in advance for any help. Regards, Milos. Hi Milos, As far as I know, you can't upload this php code to caspio server. Perhaps API intergation will help. Check the "post table row" table operation in this article Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.