Maq
Administrators-
Posts
9,363 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Maq
-
[SOLVED] Does my database structure look correct for a forum.
Maq replied to redarrow's topic in PHP Coding Help
I highly doubt all that with 1 script... Why use your software when forums such as SMF and phpBB have custom styles and are open source? -
kpetsche20: 1) Don't be ignorant, it happened twice in this thread. 2) Learn how to ask a question. 3) Post your code, rather than saying, "it doesn't convert my date!@#$!". 4) Look it up yourself. This is a very common issue.
-
where are you trying to open it?
-
if(isset($_SESSION['admin'])){ if($_SESSION['admin'] }} This doesn't do anything except check if $_SESSION['admin'] You should either do what revraz said: Or make a case/switch statement.
-
He probably did: date($timestamp); Now magically do what I want!
-
Assuming you can't figure this out... echo date('Y-m-d',$timestamp);
-
Lol... This is what date() is used for. It's tricky cause the name throws you off... Post your code!
-
flvplay.swf and flvskin.swf Wrong! Try again... We know what Flash extensions are, and the names are irrelevant. Give us the code!!!!
-
[SOLVED] Does my database structure look correct for a forum.
Maq replied to redarrow's topic in PHP Coding Help
You should make sure the database is exactly how you want it because if not it's going to be very hard to change later. I mean if you don't care, than that's a different story. I would sit down draw all the relationships, FK's, PK's, and what makes sense. Basically normalize the database. How cute... -
[SOLVED] Does my database structure look correct for a forum.
Maq replied to redarrow's topic in PHP Coding Help
I was referring to w3schools and tizag... I hope they're correct, I use them everyday! -
I guess you're not a real man...
-
[SOLVED] Does my database structure look correct for a forum.
Maq replied to redarrow's topic in PHP Coding Help
Hehe, I know! redarrow are you sure your syntax is correct for creating these tables? I looked up some basic tutorials they assign the primary key a different way along with some other things. What exactly is the error? -
Please post ALL code and errors. The code I posted is correct...
-
We would need to see your code like revraz said but it would go something like this: $sql = "SELECT your_field FROM your_table WHERE your_id = your_id"; $result = mysql_query($sql) or die(mysql_error()); $num_messages = mysql_num_rows($result); echo "You have: " . $num_messages;
-
You don't end '}' the if statement: if($ip_exist > 0){ echo "welcome again"; } else { echo "new user"; }
-
The % = modulus. Basically it's the remainder of the 2 values. Please read this.
-
[SOLVED] Does my database structure look correct for a forum.
Maq replied to redarrow's topic in PHP Coding Help
I don't see how this relates to our comments... I don't really understand this comment either. -
What does that mean? Is it returning anything? Are there errors? You need to learn basic HTML & PHP... Try this: ini_set('display_errors', 1); error_reporting(E_ALL); if(isset($_POST['select'])){ $category = $_POST['category']; $selected[$category] = " SELECTED"; $query = "SELECT id, name, label, tekst, datum, category FROM upload WHERE category = '$category' ORDER BY datum DESC"; } else { $query = "select id, name, label, tekst, datum from upload ORDER BY datum DESC"; } $result = mysql_query($query) or die('Error : ' . mysql_error()); ?> KLANTEN </pre> <form method="post" action="<?php%20echo%20%24_SERVER%5B'PHP_SEFL'%5D;%20?>"> Alles >3-5 >6-8 >9-12 </form> <br><br><br>while ($row = mysql_fetch_array($result)) { <br>?><br> <ul class="submenu"> echo $row['$label']; ?> </ul> <br> <br>}<br>?><br><b
-
[SOLVED] Does my database structure look correct for a forum.
Maq replied to redarrow's topic in PHP Coding Help
Surely you've heard of normalization. -
[SOLVED] moving a variable from one table to another
Maq replied to contra10's topic in PHP Coding Help
No, I did it because when you first get there the GET is alive, but when you hit submit, you refresh the page, killing the GET and essentially $id. p.s. - You can put GET values in a DB... -
After thinking about your problem I thought that between would be more suitable. Glad you got it working, please, if your issue is resolved mark as solved
-
[SOLVED] moving a variable from one table to another
Maq replied to contra10's topic in PHP Coding Help
Try this: mysql_connect("localhost", "root", "") or die(mysql_error()); mysql_select_db("registration") or die(mysql_error()); if (isset($_POST['submit'])){ if(is_numeric($_POST['grp'])){ $id = $_POST['grp']; $query= "SELECT * FROM groups WHERE id = $id"; $result = mysql_query($query) or die(mysql_error());; $group = mysql_fetch_assoc($result); $groupname = $group['name']; mysql_connect("localhost", "root", "") or die(mysql_error()); mysql_select_db("registration") or die(mysql_error()); $insert = "UPDATE users SET mygroups = '$groupname' WHERE username = '$username'"; $add_group = mysql_query($insert) or die(mysql_error()); } else { echo $_POST['grp'] . ": Is not numeric..."; } ?> Good Job Thank youMain } else { ?> </pre> <form action="<?php%20echo%20%24_SERVER%5B'PHP_SELF'%5D;%20?>" method="post"> "; '> </form> <br> <br> }<br>?&g -
SELECT user, MAX(score) FROM table; UPDATE table SET score = score+1 WHERE user = $user
-
[SOLVED] moving a variable from one table to another
Maq replied to contra10's topic in PHP Coding Help
It's because you need to put $id = $_GET['grp']; in a hidden field. When you get to the page you have the value from the URL. But when you post again you lose it. So, you need to have a hidden value with $id in the form and post it. -
Yes. Can you post the relevant code?