Jump to content


noob needs help


3 replies to this topic

#1 gingerj-

    Young Padawan

  • Members
  • Pip
  • 3 posts

Posted 19 July 2005 - 07:57 PM

hey 1st i need help adding info to databases through forms and 2nd i need a news script so it only displays a certain numbers of posts each page

CREATE TABLE `members` (
`member_id` int(11) NOT NULL auto_increment,
`member_name` varchar(20) NOT NULL default '',
`member_password` varchar(32) NOT NULL default '',
`member_access` int(1) NOT NULL default '0',
`member_steamid` varchar(20) NOT NULL default '',
`member_rank` varchar(20) NOT NULL default '',
PRIMARY KEY (`member_id`),
UNIQUE KEY `member_name` (`member_name`),
KEY `member_id` (`member_id`)
) TYPE=MyISAM PACK_KEYS=0 AUTO_INCREMENT=8 ; thats for members for

then need seperate form for
CREATE TABLE `profiles` (
`profile_id` int(3) NOT NULL auto_increment,
`profile_name` varchar(20) NOT NULL default '',
`profile_age` int(11) NOT NULL default '0',
`profile_picture` varchar(15) NOT NULL default '',
`profile_gender` tinyint(2) NOT NULL default '0',
`profile_location` varchar(20) NOT NULL default '',
`profile_favmap` varchar(20) NOT NULL default '',
`profile_favgun` varchar(20) NOT NULL default '',
`profile_quote` text NOT NULL,
PRIMARY KEY (`profile_id`)
) TYPE=MyISAM PACK_KEYS=0 AUTO_INCREMENT=8 ;

thanks ginger- :D

#2 Jaymz

    Retired P2L Staff

  • Members
  • PipPipPipPip
  • 4,104 posts

Posted 19 July 2005 - 08:04 PM

Are you looking for help, or for someone to do it for you?

#3 gingerj-

    Young Padawan

  • Members
  • Pip
  • 3 posts

Posted 19 July 2005 - 08:13 PM

<?php
include("dbconnect.php");//include the file that connects to the database
if(!empty($id)) {//if the title is not empty, than do this function
$id = addslashes($id);
$name = addslashes($name);
$steamid = addslashes($steamid);
$password = addslashes($password);
$access = addslashes($access);
$rank = addslashes($rank);

$sql = "INSERT INTO members (id, name, steamid, password, access, rank) VALUES ('NULL','$id','$name','$steamid','$password','$access','$rank')";//Insert all of your information into the members table in your database
$query = mysql_query($sql) or die("Cannot query the database.<br>" . mysql_error());
echo "Database Updated.<br><br>Submit Another Click <a href=submit.php>here</a><br><br>Admin Area Click <a href=http://doh-gaming.co.uk/newwebby/admin/>here</a>";
} else {//However, if the id variable is empty, than do this function
?>
<title>Admin Area</title><body text="#000000" link="#000000" vlink="#000000" alink="#000000">
<form name="form1" method="post" action="<?php echo $PHP_SELF; ?>">
  <p>Add Member</p>
  <table width="210" height="82" border="1" cellpadding="0" cellspacing="0">
    <tr> 
      <td width="42">Id </td>
      <td width="148"><input name="id" type="text" id="id"></td>
    </tr>
    <tr> 
      <td>Name</td>
      <td><input name="name" type="text" id="name"></td>
    </tr>
    <tr> 
      <td>Steam Id</td>
      <td> <input name="steamid" type="text" id="steamid"></td>
    </tr>
    <tr>
      <td>Password</td>
      <td><input name="password" type="text" id="password"></td>
    </tr>
    <tr>
      <td>Access</td>
      <td><input name="access" type="text" id="access"></td>
    </tr>
    <tr>
      <td>Rank</td>
      <td><input name="rank" type="text" id="rank"></td>
    </tr>
  </table>
  <p>
    <input name="Submit" type="submit" id="Submit" value="Submit">
  </p>
</form>

<?php
}
?>
thats for i got for members but not working...

Edited by gingerj-, 19 July 2005 - 08:14 PM.


#4 gingerj-

    Young Padawan

  • Members
  • Pip
  • 3 posts

Posted 19 July 2005 - 08:16 PM

also need to be pointed in right direction for news thing got a news script but need to add posts per page





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users