bob2006 Posted April 24, 2007 Share Posted April 24, 2007 hello cant get the veribales in the database i get this error Column count doesn't match value count at row 1 and here is the code i have can you please 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/48408-a-little-help-please/ Share on other sites More sharing options...
rcorlew Posted April 24, 2007 Share Posted April 24, 2007 Try changing this ('', '$userid', '$username')")or die(mysql_error()); to this ('' '$userid', '$username' ")or die(mysql_error()); Link to comment https://forums.phpfreaks.com/topic/48408-a-little-help-please/#findComment-236717 Share on other sites More sharing options...
sanfly Posted April 24, 2007 Share Posted April 24, 2007 what it is saying is that your number of fields and number of values in the INSERT query dont match up $INSERT=mysql_query("INSERT INTO `admin`(userid,username) VALUES ('', '$userid', '$username')")or die(mysql_error()); change it to $INSERT=mysql_query("INSERT INTO `admin`(userid,username) VALUES ('$userid', '$username')")or die(mysql_error()); Link to comment https://forums.phpfreaks.com/topic/48408-a-little-help-please/#findComment-236721 Share on other sites More sharing options...
rcorlew Posted April 24, 2007 Share Posted April 24, 2007 You have a comma before $userid, that is indicating 3 columns instead of the two you have declared. Link to comment https://forums.phpfreaks.com/topic/48408-a-little-help-please/#findComment-236722 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.