Current location: Hot Scripts Forums » Programming Languages » PHP » Problem inserting into database


Problem inserting into database

Reply
  #11 (permalink)  
Old 02-05-07, 02:17 PM
sn0wy sn0wy is offline
Newbie Coder
 
Join Date: Jan 2006
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
YAY I got it working

for people who wanted to know i had to put the strings inside the mysql function like below
PHP Code:

<?PHP

include ("includes/db.php");

$id2 $_POST['id2'];



$table_name "baccount";
      
          
$connection = @mysql_connect($dbserver$dbuser$dbpass) or die ("Couldn't Connect to database");
          
$free_text mysql_real_escape_string($_POST['free_text']); 
          
$awards_text mysql_real_escape_string($_POST['awards_text']);  
          
$db = @mysql_select_db($dbname$connection) or die(mysql_error());
          
$sql "UPDATE $table_name set free_text= '$free_text', awards_text= '$awards_text' WHERE id = '$id2'";
          
$result = @mysql_query($sql,$connection) or die(mysql_error()); 
        
          
?>
__________________
Power is in my programming fingers
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
apostrophes error while inserting variables containing them in database zitwep PHP 2 06-30-06 11:16 PM
MySQL Database Problem shamerox PHP 6 12-03-05 04:53 PM
A Language filter problem, and a problem with a for loop querying my database. . . Spreegem PHP 6 05-08-05 12:03 PM
i have a problem regarding updating database online GENIUSAdnan PHP 1 06-23-04 04:53 AM
tracking down a database problem ... bjmcintosh ASP 1 08-29-03 08:52 AM


All times are GMT -5. The time now is 07:39 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.