August 18, 201115 yr i have a admin area and user area all running off the same db with a level system how do i stop access to the login panel for users below a certin level
August 18, 201115 yr i have a admin area and user area all running off the same db with a level system how do i stop access to the login panel for users below a certin level Simple set a level field in your db with ints the number 0 could be plain access and the number 1 could be admin access then check if the user has a 0 or 1 on there account if its a 1 allow access if its a 0 deny access
August 18, 201115 yr Simple set a level field in your db with ints the number 0 could be plain access and the number 1 could be admin access then check if the user has a 0 or 1 on there account if its a 1 allow access if its a 0 deny access In the database is it best to set the field as 'tinyint' or 'set' and then have ('1','2'), I've been using set, or does it really make no difference?
August 18, 201115 yr In the database is it best to set the field as 'tinyint' or 'set' and then have ('1','2'), I've been using set, or does it really make no difference? i'd use tiny int with a default of 0
August 18, 201115 yr any particular reason? mainly because tiny int is for really small numbers and u maybe only need a few like 0 or 1 or u can do enum('0','1')
August 19, 201115 yr Author hey guys how can i get this staement to search more than one table $sql = "SELECT article_id FROM cms_articles WHERE `title` LIKE '" . $_GET['keywords'] . "')";
August 19, 201115 yr hey guys how can i get this staement to search more than one table $sql = "SELECT article_id FROM cms_articles WHERE `title` LIKE '" . $_GET['keywords'] . "')"; repeat the query and change the table name ?
August 19, 201115 yr Author it needs to be done at the same time so do i do e.g $sql and $sql2 then do mysql_query($sql,$sql2,$conn)
August 19, 201115 yr repeat the query and change the table name ? ? theres no need to repeat the query you can use mysql joins to join 1 table with another all in 1 query, you can read up on it here http://www.keithjbrown.co.uk/vworks/mysql/mysql_p5.php
Create an account or sign in to comment