hello every one
i have been programing php for 1 month and i realy like ut.
its the most wonderfull thing i have ever learned.
now i have a problem i am tring to insert into a mysql database a huge text like 400 words but there is a peoplem with it that when i try doing this it dose not let me.
but it dose not say that there is a problem it just dose not go into the database its like the code is not there like it jumps above it with out doing it.
the code that i am using is
$f = "INSERT INTO subjects (start) VALUES ('$text')";
$ss = mysqli_query($link,$f);
and when i try short text the code works fine
please tell me whats wrong????
hello i am new here and i have a problem in mysql
Moderator: General Moderators
Re: hello i am new here and i have a problem in mysql
What are you using to display any errors?
Re: hello i am new here and i have a problem in mysql
die(mysql_error());;
and
error_reporting(E_ALL);
and
error_reporting(E_ALL);
Re: hello i am new here and i have a problem in mysql
mysql_error() won't work if you've connected with mysqli_connect().
Re: hello i am new here and i have a problem in mysql
so how should i do it
?
?
Re: hello i am new here and i have a problem in mysql
o.k i changed it to mysqli_error now it gives me
Warning: mysqli_error() expects exactly 1 parameter, 0 given in C:\wamp\www\tests\add1.php on line 22
but my parmters are set and they are not 0
whats the problem?
Warning: mysqli_error() expects exactly 1 parameter, 0 given in C:\wamp\www\tests\add1.php on line 22
but my parmters are set and they are not 0
whats the problem?
Re: hello i am new here and i have a problem in mysql
o.k this is what i get i think i did the mysqli_error right now
7Errormessage: 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 's more than the 1,435 pence per share offer by Candover and Goldman Sachs Group ' at line 1
Code: Select all
$f = "INSERT INTO subjects (sub,link,start,photo,idea,dir,postion) VALUES ('$sub','$url','$text','$photo','$idea','dir','postion')";
if (!mysqli_query($link, $f))
printf("Errormessage: %s\n", mysqli_error($link));7Errormessage: 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 's more than the 1,435 pence per share offer by Candover and Goldman Sachs Group ' at line 1
Re: hello i am new here and i have a problem in mysql
You aren't escaping the input. Use mysqli_real_escape_string().