Jump to content

probelm with the insert


bob2006

Recommended Posts

ok the script im working on is not putting the right info in the database it should put the username and userid of the person that i click on but it is inserting readom usernames and userid  here the script i have i hope that some one can help

<?

include'db.php';

include'userinfo.php';

include'admin_c.php';

include'admin_info.php';

if($_GET['add'] == "admin2") {

//Create User In Database

$INSERT=mysql_query("INSERT INTO `admin`(userid,username) VALUES ('$userid',

'$username')")or die(mysql_error());

}else{

if($_GET['add'] == "admin") {

include'all_users.php';

}else{

if($level==5){

echo"5";

}else{

if($level==4){

echo"level four";

}else{

 

if($level==3){

echo"level three";

}else{

 

if($level==2){

echo"level two";

}else{

 

if($level==1){

echo"level one";

}else{

 

if($level==0){

echo"<table border='0' cellpadding='0' cellspacing='0' style='border-collapse: collapse' bordercolor='#111111' width='100%' id='AutoNumber1'>

  <tr>

    <td width='20%'>User Info DataBase</td>

    <td width='20%'>Email Accounts</td>

    <td width='20%'><a href=?add=admin>Add Admin</a></td>

    <td width='20%'>Delete Admin </td>

    <td width='20%'>Suspend Admin </td>

  </tr>

  <tr>

    <td width='20%'>Change Amin Rights </td>

    <td width='20%'>Add New Users </td>

    <td width='20%'>Changed Admin Passwords </td>

    <td width='20%'>Change Users Passwords </td>

    <td width='20%'>Read Email </td>

  </tr>

  <tr>

    <td width='20%'>Delete Members Accounts </td>

    <td width='20%'>Suspend Members Accounts</td>

    <td width='20%'> </td>

    <td width='20%'> </td>

    <td width='20%'> </td>

  </tr>

  <tr>

    <td width='20%'> </td>

    <td width='20%'> </td>

    <td width='20%'> </td>

    <td width='20%'> </td>

    <td width='20%'> </td>

  </tr>

</table>

";

}

 

 

 

}

}

}

}

}

}

}

 

?>

Link to comment
https://forums.phpfreaks.com/topic/48450-probelm-with-the-insert/
Share on other sites

this scprint with anouther one here is all_users.php

<?
include'db.php';

$data = mysql_query("SELECT * FROM users ") 
or die(mysql_error()); 
while($info = mysql_fetch_array ( $data )) 
{ 
$username=$info[username];
$userid=$info[user_id];
$password=$info['password'];
echo"<table border='1' cellpadding='0' cellspacing='0' style='border-collapse: collapse' bordercolor='#111111' width='100%' id='AutoNumber1'>
  <tr>
    <td width='33%'><a href=?add=admin2&userid=$userid&username=$username>$username</a>
</td>
    <td width='33%'>$userid
</td>
<td width='33%'>$emial
</td>
  </tr>
</table>
";


}

?>

the script above pull all the username , userid,and email that is in the users table in my database make and then make the info puled from the database in to a link with all the info i pull out so  i can insert in to that admin table

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.