I am taking sentences through a form on page. Then checking some condition and trying to insert them in database. I have issues while inserting...
foreach ($sentences as $final) {
......
else {
if(strlen($final) <= 120){
echo $final.'.<br />';}
else
echo substr($final,0,120). '.<br />';
//Inserting of final(sentences) in database starts
$sent = mysql_real_escape_string($_POST ['$final']);
$error= "Error while inserting, either User present or other. Please check database";
$inserted= "sentences inserted";
$result = mysql_query("SELECT sent FROM sentences WHERE sent='{$final}' ");
if($result)
{
$num = mysql_num_rows( $result );
if ($num == 0) {
$querypost = mysql_query ("INSERT INTO sentences (sent) VALUES ('$final')");
echo $inserted;
}
else echo $error;
}
}
}
Please correct my logic error.
Form Help
Here is the form:Line number On/Off | Expand/Contract<? include("../include/session.php"); ?> <?php if ($submit) { $sql = "UPDATE productimages
retrieving more than one max key from an array?
so i have an array of 20 numerical values (0-100) that i need to order from highest to lowest and then i need to retrieve the keys of the top ten values. $array1 =
Oracle11g Patch issue
Hi all,I'm getting the following error while installing Oracle11g Patch 11.1.0.7.0 on IBM-AIX/oracle/Disk1/stage/Components/oracle.owb.rsf/11.1.0.7.0/1/Datafiles/filegroup16.jar.when I look into the
need help with this contact form
I made this form and I need it to read the data and write the data to a table and its not working can someone please help me and show me what I have wrong so I can fix it heres the html form I left
Querying info from one table based on info in another
Hi, I am currently trying to make a part for my user driven website where one user can subscribe to another and whoever they have subscribed to is echoed back on there profile page. my users table
Comma seperated implode & modifying returned string.
I have a PHP post form that posts up to 4 variables. I need whatever variables are passed to be combined into one comma seperated string (eg variable1,variable2,variable3,variable4). This i can do
The page should be expire when cilck back button
hi,i'm new to php world.i create user registration page.when i submit it,data goes to mysql.but when i click back button of browser it shows previous page.i need a code that perform session expirewhen
help with image upload code
Hello,right now this code I have resizes images and then places them into the uploads folder is there a way to make this code upload the orignal file sizes into uploads and make it put the smaller
How to add functionality to a simple php calender?
Hello everyone, I have just finished creating a simple php calander. Can someone point me into the right direction as to what I need to do to begin to give the calender functionality?For exampleI
how can i expire the submitted page using session.
hi,i'm new to php world.i'm using "post" method.when i submit it,data goes to database successfully.BUT when i click the back button of browser(IE) the previouspage will appear.how can i