Hi,
I am trying to insert data into a table, but I am not able to insert it. I wanted to see what the error was using mysql_error() function, but it does not return any error string for me. I have pasted the code below. Any ideas where I am going wrong would be greatly appreciated.
global $error;
$link = mysqli_connect('localhost','root','');
if($link) {
$dbName = 'movieStore';
if(mysqli_select_db($link, $dbName)) {
$query = "INSERT INTO Movie(movieName,movieID, movieDescription) VALUES ('$movieName', '$movieID', '$movieDescription')";
$result = mysqli_query($link, $query);
if($result) {
$error = "Movie: $movieName successfully created";
}
else {
$error = "Error in your SQL: $query";
echo mysql_error();
}
}
else {
$error = "Unable to connect to $dbName";
}
}
}
echo $error;
It echoes that "Error in your SQL:INSERT INTO Movie(movieName,movieID, movieDescription) VALUES ('gg', '1', '') "
However, it does not print our what the error was while inserting.
Thanks a lot for looking into this
help me fix these syntax errors...
I keep getting multiple syntax errors on this script like this one:Parse error: syntax error, unexpected T_ELSE in .../scripts/php/loginform2.php on line 40when I change that line I get another on
problem with refreshing
in my site, i have an index page, it has a main div. this main div's content is changing according to the menu click as home, products etc. div is populating itz contents with html pages for these
Variables and Include
Code: [Select]<?php$header = $_COOKIE['mss']['header'];$body = $_COOKIE['mss']['body'];$footer = $_COOKIE['mss']['footer'];include '$header';include '$body';include '$footer';?>The
Alterar a hora do servidor
Se alguém souber, ajude-me a adicionar 6 horas, obrigado<tr> <th>{ov_server_time}</th> <th
PHP5/Zend 2.0 - Resources
PHP5 Snapshots
C - Reading a file into a byte array
Hi,I'm trying to read a file into a byte array in C. I have to use C as this is for a loadrunner script which is based on the C programming languageThe .Net code from the developers I'm basically
Really need helps regarding Pagination with Sort
I need someone helps regarding pagination problem...i actually want to make my page limited to let say 50 so it will look like this page1=0-50page2=51-100Then i want to sort let say based on the name
present value of sequence?
Hi
Variable uses and placement
I'm new to PL/SQL and am trying to learn about variable valid uses/placement (any pointers to any docs is appreciated...)
if else problem, help please
i have this script that i made only i try to also put in a if else for for some reason the script is not putting out the else echo. its not really a problem as the script works but it would be nice to