Page 1 of 1

Create Users in MySQL

Posted: Mon Aug 20, 2007 1:31 am
by dream2rule
Hello All,

I would like to create new users in PhpMyadmin and grant them some priviliges as in only Insert query for one user and count() for the other etc.

I want to create a number of users. No issues with that.

Can anyone help me regarding the same???


Thanks & Regards,
Dream2rule

Posted: Mon Aug 20, 2007 1:39 am
by iknownothing
If you go into your server backend, it should be pretty visible what privileges you can give to each user. I believe CPanel & Plesk use a dozen or more checkboxes to specify apon adding a new user. Hit the Sumbit/Save button, your done.

Posted: Mon Aug 20, 2007 1:49 am
by dream2rule
Yeah did the same, displayed the list of priviliges along with the checkboxes.

But i am stuck in retrieving the checked box info.

Here's the code:

Code: Select all

$priviliges = array("select_priv","insert_priv","update_priv","delete_priv","create_priv","drop_priv","reload_priv",		                      "shutdown_priv","process_priv","file_priv","grant_priv","references_priv","index_priv",
                              "alter_priv");

echo "<table border=0 cellpadding=0 cellspacing=0 align=center width='100%' border='1'>";
	  	
$count = count($priviliges)."<br>";
//echo $count;
		
for($i = 0; $i < $count; $i++ ) 
{
	if($i == 0)
		echo "<tr>";

	echo "<td align=left><input type=checkbox name=$priviliges[$i]>$priviliges[$i]</td>";
		
	echo "</tr>";
}
echo "</table>";
How do i retrieve the checked box values?

and also if i give a while loop instead of a for loop, its going in the infinite loop. can i know why?

Regards