Jump to content

[SOLVED] Commas in INSERT statement


Canman2005

Recommended Posts

okay, so would it be something like

 

$username = mysql_real_escape_string($_POST['username']);

 

?

 

If so, is there any issues doing

 

$_POST['username'] = mysql_real_escape_string($_POST['username']);

 

to save editing all the insert statements?

very secure way mate...........

<?php

//array_pop($_POST); //only  use if it an array.......

   // Stripslashes
   
if (get_magic_quotes_gpc()) {
       $value = stripslashes($value);
   }

   // Quote if not integer

   if (!is_numeric($value) || $value[0] == '0') {
       $value = "'" . mysql_real_escape_string($value) . "'";
   }
   return $value;
}
?>

if (get_magic_quotes_gpc()) {

      $value = stripslashes($value);

  }

 

  // Quote if not integer

 

  if (!is_numeric($value) || $value[0] == '0') {

      $value = "'" . mysql_real_escape_string($value) . "'";

  }

  return $value;

}

 

didnt seem to work, ill do it with the

 

mysql_real_escape_string

 

funtion

 

Thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.