MmmVomit
Members-
Posts
319 -
Joined
-
Last visited
Never
Everything posted by MmmVomit
-
Newbie help :) I'm trying to make an item tracking website
MmmVomit replied to dhendler's topic in Application Design
How exactly is the site supposed to work? What are you tracking? Why are you tracking it? -
It depends on what you want to do. You will probably have to use several of them.
-
Your original post. Which would make sense. mysql_fetch_assoc() returns an array. You want to store the result of mysql_fetch_assoc() to a different variable, then grab the ID number from the 'id' element of the array. How can I do this? The second part, I mean. $row = mysql_fetch_assoc($result); $id = $row['id'];
-
Which would make sense. mysql_fetch_assoc() returns an array. You want to store the result of mysql_fetch_assoc() to a different variable, then grab the ID number from the 'id' element of the array.
-
ID = username? Like I said, I don't know how he has his db set up, but a column called "ID" doesn't generally contain usernames.
-
^^^ run this query and post the output ^^^
-
The submit button is not part of the form. Move the closing form tag to after the submit button.
-
I don't know how your db is structured, but this could be a problem, too. WHERE id = '".$username."'";
-
Something I noticed, but I don't know if it is causing your problem or not. $aim = $_POST['aim']; $msn = $_POST['aim']; // msn = aim? $website = $_POST['msn']; // website = msn? $hobbies = $_POST['website']; // hobbies = website? $movies = $_POST['hobbies']; // movies = hobbies? $books = $_POST['movies']; // books = movies?
-
The id attributes should probably be name attributes instead. Edit: wait, nm. They're already there.
-
That second one isn't quite right. It will fail if $b is set to '0'.
-
It's not going to be part of the form, it's going to be part of the script that checks the data retrieved from the form.
-
Variable variable names don't work like that. You would need to pass two arguments, one being "_GET" and the next being "Variable", then use one parameter as an index to the array.
-
http://www.phpfreaks.com/forums/index.php/board,7.0.html
-
INNER JOIN members ON members.mem_id=topics.topic_author_id
-
<?php $sql = "SELECT * FROM table WHERE team_name = '$team_name';"; $result = mysql_query($sql) or die(mysql_error()); if(mysql_num_rows($result) > 0) { // team already registered } else { // team not registered } ?> Do the same thing for username.
-
Your WHERE clause needs to go after all the JOINs.
-
Help creating a form for an item tracking website
MmmVomit replied to dhendler's topic in PHP Coding Help
You should post your question about database structure in the Application Design/Layout forum. If you have specific questions about your code, post some code, and the specific problem you're having. -
Try getting rid of the single quotes around $year
-
Noob at PHP- making a "higher/lower" card game.
MmmVomit replied to frenz_hilpur's topic in PHP Coding Help
I don't know. If someone's trying to be clever, you just get to show them that you're more clever and output some snarky message. Banning is a bit much, but I know I'd be amused if that happened to me. You could have the hidden input and simply put a completely unrelated value in it. -
You're going to have to store the last value selected in some manner. If you want this to persiste between visits to the website, you're going to have to store it in the database somewhere. If you only want it to work per visit to the website, do what BlueSkyIS suggested, but base it on the POST or GET data.
-
All you're doing is creating a sql query and storing it in a string. You need to use mysql_query() to run the query and submit the data to the database.
-
That is strange. Are you doing any monkeying around with cookies or GET variables that could be screwing up the sessions?
-
$queryres = mysql_query("SELECT * FROM reservations WHERE YEAR(tour_date) = $var_containing_year ORDER by tour_date DESC", $mysql_connect);
-
Put code tags around your code. Code tags look like this. [code] code goes here [/code]