0

Hello,

I am starting to freak out with my php codes because it is just a mess and i get an error when i close my php tag.

This php file is going to upload an image and set a name,description, and signature from the player, but i get this error code i am talking about, and can some one help me?
I have 3page of codes, and i wonder how i can make this mess to one file with one code,
I am very greatful for the answears I get.

Codes:
http://pastebin.no/324b
http://pastebin.no/324c
http://pastebin.no/324d

In the last link from row 50-79 is the upload image script, how can I merge that to one code with the other links?

Best Regards
Puster

3
Contributors
7
Replies
9
Views
7 Years
Discussion Span
Last Post by Puster
0

Hi there,

On http://pastebin.no/324c there was a } closing bracket missing at the end of the script, see code below.

Please remember to mark thread as solved if it works.

Regards,

Max

<?php class physic_gaming_profile { 
              var $host;        
			  var $username;        
			  var $password;        
			  var $db;       
			  
			  function add_content($p) {
				                  $title = mysql_real_escape_string($p['title']);
								  $body = mysql_real_escape_string($p['body']);                
								  $signature = mysql_real_escape_string($p['signature']);                               
								  if(!$title || !$body ):                                               
								  if(!$title):                                
								  echo "<p>The user needs a name!</p>";
								  endif;  
								                        
								  if(!$body):                                
								  echo "<p>It needs content in the body!</p>";                                
								  endif;                                                               
								  echo '<p><a href="add-user.php">Prøv Igjen!:)</a></p>';                        
								  else:                                 
								  $sql = "INSERT INTO cms_profile VALUES ('$title', '$body', '$signature')";                                 
								  $res = mysql_query($sql) or die(mysql_error());                                 
								  echo "User is saved";                        
								  endif;                
			   }
}
?>
0

Hi, got new error... Column count doesn't match value count at row 1

0

Your insert inserts three columns, and you probably have more in your table. You need to specify the three you want to fill before VALUES.

0

hi when i am adding its now i am getting error "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 ''User 1', 'hahahaha ', '2Hard2Kill')' at line 1"
But, it is possible that i make a owv title for the pictures and one table for the users? And get the id's to be synced?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.