
Jessica
Staff Alumni-
Posts
8,968 -
Joined
-
Last visited
-
Days Won
41
Everything posted by Jessica
-
Well, don't do that...why do they have hash marks around them?
-
It's strtotime not str_to_time //edit Unless that's an alias I am not aware of Yep, I don't test the code before I post it I don't think str_to_time is valid, you're right.
-
Sorry, you can't do $_SESSION['cart'] = array(); every time. Check first to see if $_SESSION['cart'] isset. If not, then make it an array - if it's already set and you do that line, you make it a new empty array.
-
Your session should contain an array like $_SESSION['cart'] = array(); Then you can put each new item in that array. $item = array(); foreach($_POST as $fieldname => $fieldvalue) { $item[$fieldname] = $fieldvalue; } $_SESSION['cart'][] = $item; not tested. You may want to use the item's ID number as the key for that array to make it easy to update/delete items. Your items should all have unique IDs then you could even just do $_SESSION['cart'][$item_id'] = $quantity;
-
We had to hide in the breakroom at work. Out of the 13 tornadoes that touched down, the worst were about 1.5 hours away. Which just illustrates how freaking huge DFW is. Where I am only got rain and some small hail.
-
That's quite the mangling of my name. If you tried my suggestion, SOMETHING would have changed.
-
first of all, I don't think you understand what $_GET is. Google. Secondly, the SAME way you print the message. Where are you printing the message? I see it in your code, I want you to find it so you understand what you're doing, because you've gotten this far apparently without understanding some basic parts of PHP/MySQL.
-
When you display the message you have to select it out of the DB, that's where you get your id from. When you loop through to print them, you print the message, right? The ID is in that same set.
-
date() accepts a unix timestamp. $ts = str_to_time($row['dob']); $month = date('M', $ts); etc for year and day. edit: The way you originally had it was fine, what's the problem?
-
The same structure I described still applies. You are deleting the bottom most type of data in a structure of Parent Child Level 1 Child Level 2 You should normalize the data. In the code you just posted, nowhere do you SET $id before attempting to use it. So that's what's causing your problem.
-
Okay, here's what I would try. Anywhere you see a "header("Location: register00.php");" you need to comment that out, and kill the script then with die(); Do something like die('Error: '.$error_message); I think you're getting to the redirect because of validation, and need to see where in the process it's falling apart.
-
You need to have several tables. One for boards, one for threads, and one for posts. Your posts table will have foreign keys to thread_id and board_id. This is called normalizing data. I suggest googling that term and reading about how relational databases work, and changing your DB structure accordingly. Your links should not have username and password in them, this is very unsecure. You need to manage login by session/cookies. Lastly, to determine why $id isn't set we'd probably need to see more code. I suggest addressing the above issues first.
-
Then why are you deleting a board in your query? Also, where clauses are joined with AND, not by commas.
-
Add a die(); after your echo. (You don't need to put quotes around a variable to echo it, btw.)
-
I think there may be a terminology issue. A forum is made up of many parts. Boards which are for specific topics, Threads (or topics), which will have a subject post and replies, and posts which will have a single post by a user. Are you trying to delete an entire board, a whole thread, or a single post within a thread? On the errors, you won't get errors because you're not displaying them. your attempt to delete should read $result = mysql_query("DELETE * FROM `boards` WHERE `boardname`='$board', `id`='$id'") or die(mysql_error()); Above post is correct, and you'd get an informative error about it if you check for errors
-
It will return as rows. Did you *try* it at all?
-
Ah. The way I would do it is to join the videos to both categories and subcategories ordered BY category and subcategory, so you have an array of all the videos with what groups they belong in. Create a variable for cat = '' and subcat = ''. Then loop through that array of videos. If the current video is in a different cat/subcat than the value in the variables, echo the HTML for the cat's name. Otherwise echo the video name. Always end by storing the current cat/subcat in that var. <?php $cat = ''; $subcat = ''; $sql = "SELECT ... " // Do your join here based on category and subcat relationship $res=mysql_query($q); while($row=mysql_fetch_array($res)) { if($res['cat'] != $cat){ //It's the start of a new category } if($res['subcat'] != $subcat){ //It's the start of a new sub-category } echo $res['video']; $cat = $res['cat']; $subcat = $res['subcat']; } ?>
-
If you look at the docs you can see that you are assigning $row to a variable which is NOT an array. http://www.smarty.net/docs/en/language.syntax.variables.tpl You need to have categories be an array, I'd suggest reviewing that page.
-
I don't get what your code has to do with what you said. You can use a combo of implode and explode, or just concat the new value. $values .= ',white';
-
So is this the code that did not work? What happens when you attempt it?
-
You'll need to post the code for delete.php then. And yes you will need a unique ID.
-
If you're talking about in the form, most people would just select the text out of the box and delete it, or you can use the reset. If you're talking about deleting an existing comment, you would delete it from the database. Either way, I don't see anything having to do with delete in your code. When you say you tried it, what did you try.
-
Maybe the image is broken - is it in the same folder as the file? Don't use dreamweaver, you're making it harder for yourself to learn in the long run.
-
variables start with $ $vTakeout is a variable. vTakeout is a string literal. Turn on error reporting to ALL, and you'll get a better error for that.