AyKay47
Members-
Posts
3,281 -
Joined
-
Last visited
-
Days Won
1
Everything posted by AyKay47
-
the WHERE clause will determine how many rows are actually grabbed.. the ON clause will only determine how the tables are joined.. that being said.. try this $sql = "SELECT p.pass_id, p.property_id, p.number, p.descrip, pr.address1, pr.address2 "; $sql .= "FROM passes p LEFT JOIN property pr ON p.client_id = pr.client_id "; $sql .= "WHERE p.client_id = '".$_SESSION['client_id']."' AND p.deleted_on IS NULL "; $sql .= "ORDER BY p.pass_id DESC LIMIT $offset, $rowsperpage";
-
if your field in your db is named "upassword", why do you have it set as "password" <?php $sql="select * from users where username = '$username' and upassword = '$password')"; ?>
-
in your query.. $upassword should be $password drop the leading u in the variable
-
strtotime() returns an int timestamp... while your db field is in string format.. you will need to convert the fetched data into an int
-
alright so it is triggering you custom error message.. lets use mysql_error() to receive a mysl_error and pinpoint the problem.. <?php $rs = mysql_query( $sql, $conn ) or die( mysql_error() ); ?>
-
from your query, i can't see why it would be giving you multiple results.. can you post the relevant code
-
PRM is right, indices are case sensitive, missed that detail when I wrote the code.. will need to be changed to $_POST['Submit']
-
didn't know you were using the checkboxes in that way.. this method should work for you then.. <?php foreach ($_POST['list'] as $checkbox) { mysql_query("DELETE FROM teacher WHERE fullname='$checkbox')") or die(mysql_error); ?> } ?>
-
okay, since you are receiving a blank page.. do you have error_reporting on? <?php ini_set("error_reporting",E_ALL); if you have this set, you can view errors in your error.log file.. or you can turn display_errors on <?php ini_set("display_errors","ON"); ?> which will output the errors to the browser
-
you want that entire script inside of the if(isset($_POST['submit'])) condition you ended it after the //proceed with rest of code.. all of the code needs to be within those brackets..
-
okay well theres your problem.. your are using the wrong index names for your username and password inputs.. you hae them names "myusername" and "mypassword", so in order to grab them you will want something like <?php if(isset($_POST['submit'])){ //check for submit button click $username = $_POST['myusername']; $password = $_POST['mypassword']; // proceed with rest of code } ?>
-
1. if(mysql_num_rows($result)) in the above code you are checking if mysql_num_rows returns TRUE or FALSE, this is an incorrect usage, mysql_num_rows returns an integer of the number of rows grabbed from the query.. you will want to do something like.. if(mysql_num_rows($result) > 0) to check and make sure that at least one row was grabbed from your query statement. 2. your checkbox name does not need to be in array format.. as this accomplishes nothing.. "list" is fine 3. since I have no clue how you have your database table for this information setup.. I will assume that this information is to be stored in one row with multiple fields., which is how I would go about this.. now what I would do is store the check box values into an array, then use that array to store that values into one row in your table.. or you can use json_encode or serialize to store that array in one field.. which I will show below. <?php foreach ($_POST['list'] as $checkbox) { $checkbox_array[] = $checkbox; //store values in array } $serialize_checkbox_array = serialize($checkbox_array()); $sql = "INSERT INTO table (checkbox_array) VALUES('$serialize_checkbox_array')"; $query = mysql_query($sql) or die(mysql_error()); //use die() for debugging purposes only ?> then use unserialize to sort the data back into normal array format
-
1. first check for the submit button being clicked by using isset on the GET variable of the submit button. 2. is password a custom function? I see that you use it in your query.. 3. looks like the escaping of quotes is incorrect.. $sql="select * from users where username = '$username' and password = '$password')"; 4. no errors reported? do you have error_reporting set to either E_ALL or 1?
-
yeah goo catch thanks.. OP here's some info on it.. http://dev.mysql.com/doc/refman/5.5/en/time-zone-support.html
-
so you don't receive a mail() error? what exact domain does not work?
-
post the relevant code
-
yes, the way you have it set up now..it will post the newest row..
-
it depends on what time zone your server is set to.. check for the value of the "date.timezone" directive in your php.ini file
-
http://dev.mysql.com/doc/refman/5.0/en/join.html read it, make an attempt, if you have issues write back and we will help
-
I was surprised when you said the code i provided didn't work at first.. simple error glad it worked for you
-
read the tutorial in the link i gave you
-
post your query.. i assume you have the ON clause specified?
-
if you already did it then why are you asking how to do it?
-
you can reference the fields that are grabbed from your join clause in the ORDER BY and WHERE clause
-
this site has a nice tutorial on pagination.. http://www.phpfreaks.com/tutorial/basic-pagination