Here is my insert.php,
$ cat insert.php
<?php
$mysqli = mysqli_connect( "localhost" , "joeuser", "somepass", "testDB");
if (mysqli_connect _errno()) {
printf("Connect failed: %s\n", mysqli_connect_ error());
exit();
} else {
$sql = "INSERT INTO testTable (testField) VALUES
('".$_POST["testfield"]."')";
$res = mysqli_query($m ysqli, $sql);
if ($res === TRUE) {
echo "A record has been inserted.";
} else {
printf("Could not insert record: %s\n",
mysqli_error($m ysqli));
}
mysqli_close($m ysqli);
}
$ cat insert_post.txt
testfield=newon e
Is this correct here?
$ ab -p ./insert_post.txt http://local/Sites/insert.php
Is the insert_post.txt and insert.php required to be in the same subdir?
$ cat insert.php
<?php
$mysqli = mysqli_connect( "localhost" , "joeuser", "somepass", "testDB");
if (mysqli_connect _errno()) {
printf("Connect failed: %s\n", mysqli_connect_ error());
exit();
} else {
$sql = "INSERT INTO testTable (testField) VALUES
('".$_POST["testfield"]."')";
$res = mysqli_query($m ysqli, $sql);
if ($res === TRUE) {
echo "A record has been inserted.";
} else {
printf("Could not insert record: %s\n",
mysqli_error($m ysqli));
}
mysqli_close($m ysqli);
}
$ cat insert_post.txt
testfield=newon e
Is this correct here?
$ ab -p ./insert_post.txt http://local/Sites/insert.php
Is the insert_post.txt and insert.php required to be in the same subdir?
Comment