- Upvotes Received
- 4
- Posts with Upvotes
- 4
- Upvoting Members
- 4
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
PHP developer with an interest in NoSQL datastores
12 Posted Topics
Re: There's a few things going on within your code that needs to be addressed. But let's first cover why you're having the log in problem. You've assigned the variable `$data` to the returned result of the `count()` function. The result will be an integer, not an associative array as you … | |
Re: Just as a further addition to the improvements said above, you may want to use either the `mysqli_fetch_assoc()` function, or specify the second argument to the `mysqli_fetch_array()` function as **MYSQLI_ASSOC**. The reason being is that currently the result being set fetched is returning both an associative and numerically indexed array … | |
Re: Why not use the [array_reverse()](http://php.net/manual/en/function.array-reverse.php) function upon the array first, and then iterate through the reversed array elements afterwards with your `while` loop? | |
Re: You've forgotten to put `$_SESSION` in front of `['MM_Username']` within your query, and you have not encased the value within quotes. This should fix it: $query_order = "SELECT * FROM commande WHERE client = '{$_SESSION['MM_Username']}' ORDER BY commande.`date` DESC"; | |
Re: Just to add onto what *broj1* has said above, you should also be hashing the passwords instead of inserting them as plain text into your database. (In which case, you need not escape the password before inserting it because a harmless string - typically hexadecimal - would be produced by … | |
Re: Within your *Users* class, you could implement a handling method that returns the required page based upon the user ID. The method could look something like the following: Class Users { private $adminIDs = [1, 2]; /* class methods here */ public function whereToGo($userID) { if(in_array($userID, $this->adminIDs, TRUE)) { return … | |
Re: Could you also post what the output actually is at the moment? That should help myself and others to find out where you're going wrong easier. What I will comment on within your code though is that your use of mysql_real_escape_string() (MRES) is nugatory. The MRES function was designed to … | |
Re: I don't understand the logic of your database design. Within your "phone_nos" relation (table), why set the persons name as the primary key when people can (and will) have the same first name. Using the ID column would have made more sense as a primary (auto incrementing) key because it … | |
Re: You can do this in the form validation process once the form has been submitted. Seen as you're using the HTTP POST method, you can access the values of all named form parameters through the $_POST superglobal array. Here's a quick example: <?php if(isset($_POST['mailAction'])) { // check if the form … | |
Re: Presuming your table is currently in ascendning mode from an id (the primary, auto incrementing key), you can query your table to order the id to descending mode, and then limit the result set to just one tuple/row: SELECT * FROM table_name ORDER BY id DESC LIMIT 1; | |
Re: Edit: mis-read the post. Let me edit my reply quickly. | |
Re: I fail to see how maintanance becomes easier if you've got seven databases you're having to manage and work with for each individual application; as well as updating the data becoming easier. Making sure all of the data is up to sync and not repeated will be your main headache … |
The End.