-
Posts
3,372 -
Joined
-
Last visited
-
Days Won
18
Everything posted by Muddy_Funster
-
From the code that you posted, you need to read up a bit on the use of $_POST variables html form relevent details include form method and action as well by the way. what you should have is $name = $_POST['name']; $message = $_POST['detail']; $subject = $_POST['subject']; etc. For all the variables that you are taking from the form (assuming that you have method="POST" in your form decleration). - also, it is the elements name that you will link to, not the id. change that in your code and let us know how it goes.
-
can you post up the code you have for the login form for me.
-
OK, ill see what I can come up with and let you know soon.
-
I'm thinking hotmail as a good example of when it's not
-
:sigh: - could you please use PHP/CODE tags when posting code. Elaborate on your problem: what do you expect the code to do, what does the code do, are there any error messages, if so what are they. Help us to help you.
-
no worries, I just thought we had driffted passed those parts of the conversation.
-
But there is no field for username in the comments table... Do you have a $_SESSION variable that has the user id in it? With what you are using you could get what you want for the message pic, but not the comment. SELECT meassages.message, users.username, users.prof_image FROM users RIGHT JOIN messages ON users.username = messages.username But with the tables the way they are it's not going to do much more than that. If you have the time we might be better off starting from the ground up rather than patching together a fix.
-
need help with correct GROUP BY (might be something else) :)
Muddy_Funster replied to xwishmasterx's topic in MySQL Help
Why would the same member be listed 4 times if you are grouping by member? -
How did you get the 200 members without a working login script? Do you have a database backend that you are using with this script?
-
You need to look into the use of CSS to create your layout for the form, this isn't anything to do with PHP.
-
right, so as it stands there is no identifier for who posted any comments? can you list your $_SESSION variables that you are using?
-
OK, do not run queries within loops unless you absoloutly have to - and don't use SELECT *. something like this should do the job: $query = "SELECT prod_id, prod_name, prod_desc_file, image_file, price, cats.cat_id, cats.category AS cat_out, online_purchase ". "FROM products RIGHT JOIN cats ". "ON (cats.cat_id = products.category) ". "WHERE vets_tour = '1'"; $result = mysql_query($query, $conn); $catflag = ''; while ($row = mysql_fetch_assoc($result)){ $prodid_out = $row["prod_id"]; $prod_name_out = $row["prod_name"]; $prod_desc_file_out = $row["prod_desc_file"]; $image_file_out = $row["image_file"]; $price_out = $row["price"]; $cat_id_out = $row["cat_id"]; $category_name_out = $row["cat_out"]; $online_purchase_out = $row["online_purchase"]; $sell_cats .= $category_out . ' '; if ($catflag != $category_name_out){ echo '-'.$category_name_out.'<br>'; $catflag = $category_name_out; } echo'---'.$prodid_out.'<br>'; echo'---'.$prodid_name_out.'<br>'; echo'---'.$prodid_desc_file_out.'<br>'; echo'---'.$image_file_out.'<br>'; echo'---'.$price_out.'<br>'; echo'---'.$cat_id_out.'<br>'; echo'---'.$category_name_out.'<br>'; echo'---'.$online_purchase_out.'<br>'; } This is untested, and poorly formated for quickness sake, but should get you close to what you are looking for.
-
I don't think that's what they are. could you do a SELECT message, users.username FROM messages LEFT JOIN users ON (messages.id_fk = users.id) WHERE id_fk = <x> Where <x> is a user id that you know has posted a message please and let us know what comes back?
-
if you only want to return a single entry for each catagory then: SELECT MAX(id) AS id, date, txt, categorie FROM products WHERE date=$today GROUP BY categorie
-
Y'all need to use the code/php tags when you're posting code. Without the actual tables there isn't much comment to make on the SQL code...and there is a distinct lack of a question
-
you missed out the important one :
-
this : if (isset($_POST['eventid'])){ is an example of checking to see if a variable is set. isset and unset are native php functions for checking and dropping variables.
-
What you just atempted was to put the contents of $_REQUEST['username'] and $_REQUEST['password'] to the screen as text. but as they have no given values PHP is telling you that it can't do what you are asking. How are you getting username and password values into the $_REQUEST array? Could you post the code for that part of the process?
-
Problems error with Mysql setting up register form
Muddy_Funster replied to Artmark's topic in PHP Coding Help
there are two locations in your code where you have an or die : first during a select, the second during the insert. If you change each of them to the code that pikachu gave you you should get something back that we can work with to help you. -
which part? and how are you implememting it - one page or multiple?
-
Not if the mail proccessing page is set to check the existance of a variable that is unset during the proccess. you would then completed page seporate again, using a header at the end of the mail process, taking you to another page, so that if you press the back button from this page the variable will come through as unset and you can redirect (using another header) to wherever you want them to go. If your comfortable enough with using IF you could have it all on the one page.
-
Too many queries is when you are using more than you need to - it varies hugely dependant on circumstance and as such can't really be answered. Rather than worry about the amount of queries, focus on the logic of them - make each querie as efficient and effective as you can, and then the number of them will be of negligable difference anyway. It's all about quality not quantity.
-
there are a couple of ways, header redirect is the most popular (I think)
-
you didn't do what I suggested Try changing the top of the page code to this: <?php SESSION_START(); echo '$_REQUEST username value = '.$_REQUEST['username'].'<br>'; echo '$_REQUEST password value = '.$_REQUEST['password'].'<br>'; die(); //rest of your page code here let us know what it sais is in the variables - or if you get the same error again.