RP PHP Problems

Mango2735

The Sexy One.
Oct 13, 2010
288
3
1. How do i fix this php code so that it goes to a specific id not make a new table.
PHP:
[/B][B]<?php [/B][/B][/B]
[php]<?php
/*================================================================+\
|| # PHPRetro - An extendable virtual hotel site and management
|+==================================================================
|| # Copyright (C) 2009 Yifan Lu. All rights reserved.
|| # http://www.yifanlu.com
|| # Parts Copyright (C) 2009 Meth0d. All rights reserved.
|| # http://www.meth0d.org
|| # All images, scripts, and layouts
|| # Copyright (C) 2009 Sulake Ltd. All rights reserved.
|+==================================================================
|| # PHPRetro is provided "as is" and comes without
|| # warrenty of any kind. PHPRetro is free software!
|| # License: GNU Public License 3.0
|| # http://opensource.org/licenses/gpl-license.php
\+================================================================*/

$page['allow_guests'] = true;
require_once('./includes/core.php');
require_once('./includes/session.php');
$lang->addLocale("credits.credits");

$page['id'] = "instert";
$page['name'] = "Insterted Page";
$page['bodyid'] = "home";
$page['cat'] = "community";

require_once('./templates/community_header.php');

$getGangID = $input->FilterText($_GET['gang_id']);
?>
 
<?php
$con = mysql_connect("localhost","root","12051996");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("xoa", $con);

$sql="INSERT INTO gang_corps (color1, color2) WHERE gang_id='$getGangID' ";
VALUES
('$_POST[color1]','$_POST[color2]')";
 
if (!mysql_query($sql,$con))
  {
  die('Error: ' . mysql_error());
  }
echo "The Gang Colors have been Saved";

mysql_close($con)
?>[php]

[B][B][B]2. How do i also make it so it adds not  just replaces.. So, if i want to add 3 to credits, it wont just make the table fro credits 3. it will add to it.[/B][/B][/B]

[B][B][B]3. How do i make a page where if a user ahs already been to it they can't go back. ;p[/B]][/B][/B][/B]
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,195
3,905
1) No need to re-connect to the database.
2) For updating, use UPDATE, rather than INSERT.
3 ) You just gave everyone your password.
4) Goodbye.
 

Users who are viewing this thread

Top