Jump to content

PHP doesn't understand me (Im telling it to do the wrong thing)


mattd8752

Recommended Posts

Well, Im not positive, but I believe that PHP is misinterpreting what I am telling it to do.  I don't quite get how, but I'll show you a bit of code and what it is supposed to do:

[code]
$usrid = 0;
$sql = "SELECT * FROM userdata";
$query = mysql_query($sql);
while($row = mysql_fetch_array($query)){
  $currid = $row['id'];
  if($usrid < $currid){
  $usrid = $currid;
  }
}
$usrid = $usrid + "1";

$carid = 0;
$sql = "SELECT * FROM userdata";
$query = mysql_query($sql);
while($row = mysql_fetch_array($query)){
  if($carid < $row['carid']){
  $carid = $row['carid'];
  }
}
$carid = $carid + "1";
$sql = "SELECT * FROM salecars";
$query = mysql_query($sql);
while($row = mysql_fetch_array($query)){
  if($carid = $row['carid']){
  $carname = $row['name'];
  if($row['type'] != "beginner"){
  echo "Stop trying to cheat.</div><div id=\"footer\"><b>".$onlinet."</b></div>";
  die();
  }
  }
}
mysql_query("INSERT INTO userdata (id,owner,cash,carid) VALUES ('".$usrid."','".$userdata['username']."','10000', '".$carid."')");echo mysql_error();
mysql_query("INSERT INTO car (carid,name,owner) VALUES ('".$carid."','".$carname."','".$userdata['username']."')");echo mysql_error();
[/code]

That code basically assigns IDs to be inserted into the database.  I am getting their UserID fine, however when I look in the database, their carid in both the car and userdata database is = 11.

If someone could fix this please try.  If you need to see the whole code just ask, but just a warning it has 300 and something lines, and it is a bit messy since I coded it all tonight (without a break from this file).
Link to comment
Share on other sites

I know it isn't designed properly, this is because PHPbb is intergrated with my site so about half the stuff is in 1 database half in another.  Please just try and help me fix this because if I were to do auto incrementing IDs it would screw up all of my code leaving me with another 15-20 hours of coding (which would normally take ten times as long as this one on my schedule).
Link to comment
Share on other sites

Bump, could someone explain how I would change this script:

[code]<?php
define('IN_PHPBB', true);
$site_root_path = './'; //<-- Modify
$phpbb_root_path2 = '/forum/'; //<-- Modify
$phpbb_root_path = $site_root_path . $phpbb_root_path2;
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.php');
include($phpbb_root_path . 'config.php');
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//login check
if($userdata['session_logged_in']){
}else{
echo "Please <a href=\"".$phpbb_root_path."/login.php\">login</a>";
die();
}
//private message check
if ( $userdata['user_new_privmsg'] )
{
$l_message_new = ( $userdata['user_new_privmsg'] == 1 ) ? $lang['New_pm'] : $lang['New_pms'];
$l_privmsgs_text = sprintf($l_message_new, $userdata['user_new_privmsg']);

if ( $userdata['user_last_privmsg'] > $userdata['user_lastvisit'] )
{
$sql = "UPDATE " . USERS_TABLE . "
SET user_last_privmsg = " . $userdata['user_lastvisit'] . "
WHERE user_id = " . $userdata['user_id'];
if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not update private message new/read time for user', '', __LINE__, __FILE__, $sql);
}
$s_privmsg_new = 1;
$icon_pm = $images['pm_new_msg'];
}
else
{
$s_privmsg_new = 0;
$icon_pm = $images['pm_no_new_msg'];
}
}
else
{
$l_privmsgs_text = $lang['No_new_pm'];

$s_privmsg_new = 0;
$icon_pm = $images['pm_no_new_msg'];
}

if ( $userdata['user_unread_privmsg'] )
{
$l_message_unread = ( $userdata['user_unread_privmsg'] == 1 ) ? $lang['Unread_pm'] : $lang['Unread_pms'];
$l_privmsgs_text_unread = sprintf($l_message_unread, $userdata['user_unread_privmsg']);
}
else
{
$l_privmsgs_text_unread = $lang['No_unread_pm'];
}
//private message check finish




$user_forum_sql = ( !empty($forum_id) ) ? "AND ( u.user_session_page = $forum_id
OR s.session_page = $forum_id)" : "";

$sql = "SELECT u.username, u.user_id, u.user_allow_viewonline, u.user_level, s.session_logged_in, s.session_ip
FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s
WHERE u.user_id = s.session_user_id
AND ( s.session_time >= ".( time() - 300 ) . "
OR u.user_session_time >= " . ( time() - 300 ) . " )
$user_forum_sql
ORDER BY u.username ASC";
$result = $db->sql_query($sql);
if(!$result)
{
message_die(GENERAL_ERROR, "Couldn't obtain user/online information.", "", __LINE__, __FILE__, $sql);
}

$userlist_ary = array();
$userlist_visible = array();

$logged_visible_online = 0;
$logged_hidden_online = 0;
$guests_online = 0;
$online_userlist = "";

$prev_user_id = 0;
$prev_session_ip = 0;

while( $row = $db->sql_fetchrow($result) )
{
// User is logged in and therefor not a guest
if( $row['session_logged_in'] )
{
// Skip multiple sessions for one user
if( $row['user_id'] != $prev_user_id )
{
$style_color = "";
if( $row['user_level'] == ADMIN )
{
$row['username'] = '<b>' . $row['username'] . '</b>';
$style_color = 'style="color:#' . $theme['fontcolor3'] . '"';
}
else if( $row['user_level'] == MOD )
{
$row['username'] = '<b>' . $row['username'] . '</b>';
$style_color = 'style="color:#' . $theme['fontcolor2'] . '"';
}

if( $row['user_allow_viewonline'] )
{
$user_online_link = '<a href="' . append_sid($phpbb_root_path2."profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'>' . $row['username'] . '</a>';
$logged_visible_online++;
}
else
{
$user_online_link = '<a href="' . append_sid($phpbb_root_path."profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'><i>' . $row['username'] . '</i></a>';
$logged_hidden_online++;
}

if( $row['user_allow_viewonline'] || $userdata['user_level'] == ADMIN )
{
$online_userlist .= ( $online_userlist != "" ) ? ", " . $user_online_link : $user_online_link;
}
}
}
else
{
if( $row['session_ip'] != $prev_session_ip ){
$guests_online++;
}
}

$prev_user_id = $row['user_id'];
$prev_session_ip = $row['session_ip'];
}

if( empty($online_userlist) )
{
$online_userlist = $lang['None'];
}
$online_userlist = ( ( isset($forum_id) ) ? $lang['Browsing_forum'] : $lang['Registered_users'] ) . " " . $online_userlist;
$online_userlist = "<span style=\"background-color: #C0C0C0\">" . $online_userlist . "</span>";
$total_online_users = $logged_visible_online + $logged_hidden_online + $guests_online;

if($total_online_users > $board_config['record_online_users'])
{
$sql = "UPDATE " . CONFIG_TABLE . "
SET config_value = '$total_online_users'
WHERE config_name = 'record_online_users'";
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't update online user record (nr of users)", "", __LINE__, __FILE__, $sql);
}

$sql = "UPDATE " . CONFIG_TABLE . "
SET config_value = '" . time() . "'
WHERE config_name = 'record_online_date'";
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't update online user record (date)", "", __LINE__, __FILE__, $sql);
}

$board_config['record_online_users'] = $total_online_users;
$board_config['record_online_date'] = time();
}

if( $total_online_users == 0 )
{
$l_t_user_s = $lang['Online_users_zero_total'];
}
else if( $total_online_users == 1 )
{
$l_t_user_s = $lang['Online_user_total'];
}
else
{
$l_t_user_s = $lang['Online_users_total'];
}

if( $logged_visible_online == 0 )
{
$l_r_user_s = $lang['Reg_users_zero_total'];
}
else if( $logged_visible_online == 1 )
{
$l_r_user_s = $lang['Reg_user_total'];
}
else
{
$l_r_user_s = $lang['Reg_users_total'];
}

if( $logged_hidden_online == 0 )
{
$l_h_user_s = $lang['Hidden_users_zero_total'];
}
else if( $logged_hidden_online == 1 )
{
$l_h_user_s = $lang['Hidden_user_total'];
}
else
{
$l_h_user_s = $lang['Hidden_users_total'];
}

if( $guests_online == 0 )
{
$l_g_user_s = $lang['Guest_users_zero_total'];
}
else if( $guests_online == 1 )
{
$l_g_user_s = $lang['Guest_user_total'];
}
else
{
$l_g_user_s = $lang['Guest_users_total'];
}

$l_online_users = sprintf($l_t_user_s, $total_online_users);
$l_online_users .= sprintf($l_r_user_s, $logged_visible_online);
$l_online_users .= sprintf($l_h_user_s, $logged_hidden_online);
$l_online_users .= sprintf($l_g_user_s, $guests_online);
mysql_close();
include "dbconnect.php";
$onlinet = "$l_online_users<br>$online_userlist<br>";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>F1 Simulator</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
* { margin:0; padding:0; }
BODY { background-color:#651;
font-size:16px; }
a { color:#807859;
text-decoration:none; }
a:hover { text-decoration:underline; }
#header { background-color:#BFAC60;
padding:8px; }
#left { float:left;
width:200px;
padding:8px;
background-color:#dc8; }
#right { float:right;
width:200px;
padding:8px;
background-color:#dda }
#center { margin-right:215px;
margin-left:215px;
padding:8px;
background-color:#eec; }
#footer { clear:both;
background-color:#CCC08F;
padding:8px; }
#left, #right, #center { height: 400px;
}
#wrapper { overflow:hidden; }
</style>
</head>
<body>
<div id="header"><h1>F1 Racing Simulator</h1></div>
<div id="left"><b>Menu</b><br>
<?php
include "menu.php";
?>
</div>
<div id="right"><b>Private Messages</b><br><a href="<?php echo $phpbb_root_path2; ?>privmsg.php?folder=inbox"><?php echo $l_privmsgs_text; ?></a></div>
<div id="center">
<?php
if(!isset($_POST['submit'])){
?><p><b>Welcome <?php echo $userdata['username']; ?>!</b></p><br><br>
<h1>Team Setup</h1><br>
Please fill in the following...<br>
<FORM action="setupteam.php" method="post">
Your Desired Team Name: <input type="text" name="teamname"><br>
Your Desired Starting Car:
<select name="carid">
<?php
$result = mysql_query("select * from salecars WHERE type = 'beginner'");

//grab all the content
while($r=mysql_fetch_array($result))
{
  $name=$r["name"];
  $id=$r["carid"];
  //display the car
  echo "<option value = \"".$id."\">".$name."</option>";
}
?>
</select><br>
<INPUT type="submit" name="submit" value="Set Up My Team">
</FORM>
<?
}else{
echo "Attempting to SetUp your car...<br>";
  //time to check if they've got a team already (they're trying to get a free car)...


$found = mysql_result(mysql_query('SELECT count(0) FROM `userdata` WHERE `owner` = "'.$userdata['username'].'" LIMIT 1'), 0, 0);
if ( $found > 0 ){
echo ("You already have a racing team...</div><div id=\"footer\"><b>".$onlinet."</b></div>");
die();
}else{

$usrid = 0;
$sql = "SELECT * FROM userdata";
$query = mysql_query($sql);
while($row = mysql_fetch_array($query)){
  $currid = $row['id'];
  if($usrid < $currid){
  $usrid = $currid;
  }
}
$usrid++;

$carid = 0;
$sql = "SELECT * FROM userdata";
$query = mysql_query($sql);
while($row = mysql_fetch_array($query)){
  if($carid < $row['carid']){
  $carid = $row['carid'];
  }
}
$carid++;
$sql = "SELECT * FROM salecars";
$query = mysql_query($sql);
while($row = mysql_fetch_array($query)){
  if($carid = $row['carid']){
  $carname = $row['name'];
  if($row['type'] != "beginner"){
  echo "Stop trying to cheat.</div><div id=\"footer\"><b>".$onlinet."</b></div>";
  die();
  }
  }
}
mysql_query("INSERT INTO userdata (id,owner,cash,carid) VALUES ('".$usrid."','".$userdata['username']."','10000', '".$carid."')");echo mysql_error();
mysql_query("INSERT INTO car (carid,name,owner) VALUES ('".$carid."','".$carname."','".$userdata['username']."')");echo mysql_error();








echo "Your racing team is now setup!  Good luck!  Please return to the <a href=\"main.php\">home page</a>";
}



}
?>
</div>
<div id="footer"><b><?php echo $onlinet; ?></b></div>
</body>
</html>[/code]
to use auto incrementing ID please.  Im not quite sure how that would work.  For those who need to see the DB structure the SQL is as follows:
[code]-- phpMyAdmin SQL Dump
-- version 2.9.0.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jan 26, 2007 at 05:19 PM
-- Server version: 4.1.21
-- PHP Version: 4.4.2
--
-- Database: `mattd_racingdb`
--

-- --------------------------------------------------------

--
-- Table structure for table `car`
--

CREATE TABLE `car` (
  `carid` varchar(255) NOT NULL default '',
  `name` varchar(255) NOT NULL default '',
  `owner` varchar(255) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `car`
--

INSERT INTO `car` VALUES ('11', 'Super Aguri-Honda', 'Admin');

-- --------------------------------------------------------

--
-- Table structure for table `carbrakesuspension`
--

CREATE TABLE `carbrakesuspension` (
  `carid` varchar(255) NOT NULL default '',
  `frictionkv` varchar(255) NOT NULL default '',
  `frontbrake` varchar(255) NOT NULL default '',
  `backbrake` varchar(255) NOT NULL default '',
  `handbrake` varchar(255) NOT NULL default '',
  `autoclutchbrake` varchar(255) NOT NULL default '',
  `frontspring` varchar(255) NOT NULL default '',
  `backspring` varchar(255) NOT NULL default '',
  `frontdamper` varchar(255) NOT NULL default '',
  `backdamper` varchar(255) NOT NULL default '',
  `frontantirollbar` varchar(255) NOT NULL default '',
  `backantirollbar` varchar(255) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `carbrakesuspension`
--


-- --------------------------------------------------------

--
-- Table structure for table `carengine`
--

CREATE TABLE `carengine` (
  `carid` varchar(255) NOT NULL default '',
  `maxspeedrpm` varchar(255) NOT NULL default '',
  `points` varchar(255) NOT NULL default '',
  `currentpoint` varchar(255) NOT NULL default '',
  `currentpointspeed` varchar(255) NOT NULL default '',
  `currentpointtorque` varchar(255) NOT NULL default '',
  `maxfrictiontorque` varchar(255) NOT NULL default '',
  `frictionkv` varchar(255) NOT NULL default '',
  `momentofinertia` varchar(255) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `carengine`
--


-- --------------------------------------------------------

--
-- Table structure for table `cargearbox`
--

CREATE TABLE `cargearbox` (
  `carid` varchar(255) NOT NULL default '',
  `drivenwheels` varchar(255) NOT NULL default '',
  `frictionkv` varchar(255) NOT NULL default '',
  `numberofgears` varchar(255) NOT NULL default '',
  `1` varchar(255) NOT NULL default '',
  `2` varchar(255) NOT NULL default '',
  `3` varchar(255) NOT NULL default '',
  `4` varchar(255) NOT NULL default '',
  `5` varchar(255) NOT NULL default '',
  `6` varchar(255) NOT NULL default '',
  `final` varchar(255) NOT NULL default '',
  `reverse` varchar(255) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `cargearbox`
--


-- --------------------------------------------------------

--
-- Table structure for table `cartyres`
--

CREATE TABLE `cartyres` (
  `carid` varchar(255) NOT NULL default '',
  `frontreactionspring` varchar(255) NOT NULL default '',
  `backreactionspring` varchar(255) NOT NULL default '',
  `frontfrictionkv` varchar(255) NOT NULL default '',
  `backfrictionkv` varchar(255) NOT NULL default '',
  `frontcoefficientoffriction` varchar(255) NOT NULL default '',
  `backcoefficientoffriction` varchar(255) NOT NULL default '',
  `frontpoints` varchar(255) NOT NULL default '',
  `backpoints` varchar(255) NOT NULL default '',
  `frontshapefactor` varchar(255) NOT NULL default '',
  `backshapefactor` varchar(255) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `cartyres`
--


-- --------------------------------------------------------

--
-- Table structure for table `carwheelsuspensionsteering`
--

CREATE TABLE `carwheelsuspensionsteering` (
  `carid` varchar(255) NOT NULL default '',
  `frontcamber` varchar(255) NOT NULL default '',
  `backcamber` varchar(255) NOT NULL default '',
  `fronttoe` varchar(255) NOT NULL default '',
  `backtoe` varchar(255) NOT NULL default '',
  `frontsuspensionxangle` varchar(255) NOT NULL default '',
  `backsuspensionxangle` varchar(255) NOT NULL default '',
  `frontsuspensionyangle` varchar(255) NOT NULL default '',
  `backsuspensionyangle` varchar(255) NOT NULL default '',
  `steeringxangle` varchar(255) NOT NULL default '',
  `steeringyangle` varchar(255) NOT NULL default '',
  `fulllockangle` varchar(255) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `carwheelsuspensionsteering`
--


-- --------------------------------------------------------

--
-- Table structure for table `parts`
--

CREATE TABLE `parts` (
  `name` varchar(255) NOT NULL default '',
  `cost` varchar(255) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `parts`
--

INSERT INTO `parts` VALUES ('Monocoque', '117900');
INSERT INTO `parts` VALUES ('Bodywork', '35000');
INSERT INTO `parts` VALUES ('Rear wings', '20000');
INSERT INTO `parts` VALUES ('Front wings', '18750');
INSERT INTO `parts` VALUES ('Engine', '214300');
INSERT INTO `parts` VALUES ('Gearbox', '128600');
INSERT INTO `parts` VALUES ('Exhaust', '11600');
INSERT INTO `parts` VALUES ('Telemetrie', '107150');
INSERT INTO `parts` VALUES ('Fire extinguisher', '3200');
INSERT INTO `parts` VALUES ('Brake discs', '6200');
INSERT INTO `parts` VALUES ('Brake pads', '3600');
INSERT INTO `parts` VALUES ('Brake calipers', '23000');
INSERT INTO `parts` VALUES ('Wheels (set)', '4120');
INSERT INTO `parts` VALUES ('Tyre', '1000');
INSERT INTO `parts` VALUES ('Shock absorber (set)', '5200');
INSERT INTO `parts` VALUES ('Pedals', '2200');
INSERT INTO `parts` VALUES ('Dashboard', '3200');
INSERT INTO `parts` VALUES ('Steering', '4300');
INSERT INTO `parts` VALUES ('Mirrors', '1300');
INSERT INTO `parts` VALUES ('Steering wheel', '39000');
INSERT INTO `parts` VALUES ('Tank', '10700');
INSERT INTO `parts` VALUES ('Under work', '8600');
INSERT INTO `parts` VALUES ('Suspension', '40000');
INSERT INTO `parts` VALUES ('Driver''s seat', '3000');
INSERT INTO `parts` VALUES ('Stickers', '1600');
INSERT INTO `parts` VALUES ('Other Components', '43000');

-- --------------------------------------------------------

--
-- Table structure for table `salecars`
--

CREATE TABLE `salecars` (
  `carid` varchar(255) NOT NULL default '',
  `type` varchar(255) NOT NULL default '',
  `name` varchar(255) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `salecars`
--

INSERT INTO `salecars` VALUES ('1', 'beginner', 'Renault F1');
INSERT INTO `salecars` VALUES ('2', 'beginner', 'Ferrari');
INSERT INTO `salecars` VALUES ('3', 'beginner', 'McLaren-Mercedes');
INSERT INTO `salecars` VALUES ('4', 'beginner', 'Honda');
INSERT INTO `salecars` VALUES ('5', 'beginner', 'Sauber-BMW');
INSERT INTO `salecars` VALUES ('6', 'beginner', 'Toyota');
INSERT INTO `salecars` VALUES ('7', 'beginner', 'Red Bull Racing-Ferrari');
INSERT INTO `salecars` VALUES ('8', 'beginner', 'Williams-Cosworth');
INSERT INTO `salecars` VALUES ('9', 'beginner', 'Scuderia Toro Rosso');
INSERT INTO `salecars` VALUES ('10', 'beginner', 'SpykerMF1-Toyota');
INSERT INTO `salecars` VALUES ('11', 'beginner', 'Super Aguri-Honda');

-- --------------------------------------------------------

--
-- Table structure for table `teams`
--

CREATE TABLE `teams` (
  `owner` varchar(255) NOT NULL default '',
  `name` varchar(255) NOT NULL default '',
  `carid` varchar(255) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `teams`
--


-- --------------------------------------------------------

--
-- Table structure for table `userdata`
--

CREATE TABLE `userdata` (
  `id` varchar(255) NOT NULL default '',
  `owner` varchar(255) NOT NULL default '',
  `cash` varchar(255) NOT NULL default '',
  `carid` varchar(255) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `userdata`
--

INSERT INTO `userdata` VALUES ('1', 'Admin', '10000', '11');

[/code]

Please help if you can.  Thats all I have that I can provide ATM.  If you notice

INSERT INTO `userdata` VALUES ('1', 'Admin', '10000', '11');

that carid is 11.  It should be assigned in order.  And I dropped other users to retry the script.  ID does work

Please don't quote my source, I plan to EDIT it out.
Link to comment
Share on other sites

You are setting id and carid's datatype to a string (VARCHAR) These columns should have their data types set to INT not VARCHAR. If your column is VARCHAR then any data in that column is treated as a string - even if its a number.

When its INT the data will be treated as an interger not a string. So when you are doing this:
[code]$usrid = $usrid + "1";
// OR
$carid = $carid + "1";[/code]
What you are telling PHP is to add the [b]string[/b] 1 to the end of the [b]string[/b] in $carid so you will be getting 11 all the time. PHP wont add the numbers! In order for PHP to treat it as a number you need change the id and carid data types to INT and remove the quotes from 1.

So this will be your query when you create your userdata table:
[code]CREATE TABLE `userdata` (
  `id` INT(11) NOT NULL default '',
  `owner` varchar(255) NOT NULL default '',
  `cash` varchar(255) NOT NULL default '',
  `carid` INT(11) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1;[/code]

to change you code so the id column autoincrements you need to change your SQL query for the id column to this:
[code]`id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY[/code]
MySQL will now increase the id by one automatically when ever you add an entry to the usertable.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.