View Single Post
  #1  
Old 07-30-2006, 12:06 PM
splendor splendor is offline
Junior Member
 
Join Date: Jul 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
splendor is on a distinguished road
Default PHP/MySql problems

Here is my code:


PHP Code:
$id = $_GET['id']; // The item id //
$name = $_REQUEST['item']; // Name of the item //
$amount = $_POST['amount'];

$owner = $_REQUEST['owner']; // The obj_id of the character (owner) //

// Check if we already have a script for this item //
if (!file_exists("store_items/$name.php"))
{
// If we do not, copy the template script and rename it to this item's name //
copy("store_items/template.php", "store_items/$name.php");
}


It works fine, except for when an item contains a ' in it. For some reason the ' jacks everything up. This also jacks all other mysql queries because all that's getting inserted is "john" instead of "john's item" -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
  Webmaster Forums - View Single Post - PHP/MySql problems
View Single Post
  #1  
Old 07-30-2006, 12:06 PM
splendor splendor is offline
Junior Member
 
Join Date: Jul 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
splendor is on a distinguished road
Default PHP/MySql problems

Here is my code:


PHP Code:
$id = $_GET['id']; // The item id //
$name = $_REQUEST['item']; // Name of the item //
$amount = $_POST['amount'];

$owner = $_REQUEST['owner']; // The obj_id of the character (owner) //

// Check if we already have a script for this item //
if (!file_exists("store_items/$name.php"))
{
// If we do not, copy the template script and rename it to this item's name //
copy("store_items/template.php", "store_items/$name.php");
}


It works fine, except for when an item contains a ' in it. For some reason the ' jacks everything up. This also jacks all other mysql queries because all that's getting inserted is "john" instead of "john's item" -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote