I am trying out the simple medoo.in php database framework.
just saving a form input into database
<?php
require_once 'includes/medoo.php';
$FName = $_POST["FName"];
$EMail = $_POST["EMail"];
$db = new medoo();
$db->insert("wp_discount", ["FName" => "TT","EMail" => "ROAR"]);
?>
<html>
<body>
Welcome <?php echo $FName; ?><br>
Your email address is: <?php echo $EMail; ?>
</body>
</html>
the problem is with the insert line. when i remove that line everything works fine.
i get internal server error
Error log:
20140401T040139: www.geteasyread.com/csspure/form.php
PHP Parse error: syntax error, unexpected '[' in /hermes/waloraweb010/b1216/moo.skychewcom/easyread/csspure/form.php on line 8
but i don't see what i am doing wrong.
use
$db->insert("wp_discount", array("FName" => "TT","EMail" => "ROAR"));
short array syntax exists in php >= 5.4, maybe that's not your case
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.