Maq
Administrators-
Posts
9,363 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Maq
-
If you go to login.php and put in: echo $_GET['i']; it will output "f". It's a method to transfer data. Read more here...
-
To separate things you can use explode. Something like: $pokemon = "Vaporeon"; $pieces = expode(",", $pokemon[1]); if(in_array($pokemon, $pieces) { echo "This record has " . $pokemon . "!"; }
-
Well if your query doesn't match a username then the variables adminuser will never be assinged to anything because $row['username'] never exists. You should do a check to see if any rows are returned: if(mysql_num_rows($result) == 0) { echo "Error no matches for that username"; } else { $adminuser = $row['username']; // Proceed with rest of code . . . }
-
YW It's always the little things that cause the problems. They're always so little that you overlook them and complicate the problem more than it is. Glad it's working.
-
First indent your code. Second use header unless base.php outputs something. include "base.php"; $_SESSION = array(); session_destroy(); header('Location: index.php'); ?>
-
Thanks! I'll take that as it's working properly. Please mark as [sOLVED] if so, thanks!
-
This line is missing a single quote before the variable: VALUES ('$upload_project_images_name', Change this back to: foreach($_FILES['upload_project_images']['name'] as $upload_project_images) {
-
Looks like you're ending a div too soon or something not in a container. It's really impossible to tell due to the fact that it could be a multitude of things. Oh yeah, and because we have no relevant code! (notice how I said relevant, and not ALL the code)
-
SimpleXML - how to insert varaible into queries????
Maq replied to squariegoes's topic in PHP Coding Help
Excellent, please mark as [sOLVED] so everyone knows. Thanks! -
You're using 1 equal sign which is assigning and will always result to true. You need to use 2 equals signs which will compare the values. And instead of 'and' use '&&'. if($mode == 'edit' && $_SESSION['username'] == '$user'){
-
Not sure where $project_id comes from but you can try this: $i = 1; foreach($_FILES['upload_project_images'] AS $upload_project_images) { $upload_project_images_pathinfo = pathinfo($upload_project_images); $upload_project_images_name = $upload_project_images_pathinfo['filename'] . "_".$i.".". $upload_project_images_pathinfo['extension']; $p_image_query = "INSERT INTO " . IMAGE_TABLE . "(i_name, i_type, i_project_id) VALUES ($upload_project_images_name', '3', '$project_id')"; $result=mysql_query($p_image_query) or die(mysql_error()); $i++; } ?>
-
If you are seeing no content then most likely you have a syntactial error. Put this at the top of your page and tell me what errors output: ini_set ("display_errors", "1"); error_reporting(E_ALL); Which images are you referring to? The whole page doesn't show any images at all? If that's the case then you probably have the wrong path. Echo out your variables to ensure they are pointed the right directory and image.
-
What exactly are you talking about? This could refer to a multitude of things...
-
And what exactly does that mean...?
-
Adding DISTINCT doesn't do anything since usernames should already be distinct... Enough with the semantics, his query throws an error, we'll worry about the results later.
-
Test it out. Create an invalid query and see what happens...
-
That still wouldnt' get the desired results if he wanted any username that BEGINS with 'Beaufor'. But I do agree that his query call should look like this: $info=$db->query($query);
-
What if he wants all user names that begin with 'Beaufor'?
-
[SOLVED] select statement with multiple conditions
Maq replied to tommy445's topic in PHP Coding Help
You need to check out some basic SQL syntax. Your arrays were missing ']', you didn't use AND for multiple where clause, and some other stuff I fixed. $sel = "SELECT * FROM site_clients WHERE client_first_name = '{$_POST['client_first_name']}' AND client_last_name = '{$_POST['client_last_name']}' AND client_account_number= '{$_POST['client_account_number']}'"; -
Can you post the exact portion of code? Why are you putting quotes around your $query variable when it's already a string? $db->query("{$query}");
-
Here's the easiest way to explain what an abstract class does, from the manual:
-
You sure the session is started, you may need to add session_start(); to the top of your page. Echo it out to make sure. Or else $userid will be empty and the query won't return anything.