Maq
Administrators-
Posts
9,363 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Maq
-
$date = "01/04/1977"; $tom = date("m/d/Y", strtotime("$date +1 Day")); echo $tom; ?>
-
I have no clue what you're talking about, could you post a link from the previous thread? Or elaborate a bit more?
-
mvc what m stands for what v stands for what c stands for
Maq replied to fantomel's topic in Miscellaneous
There's a significant difference between understanding the theory of the MVC pattern and actually creating/coding your own. There's a lot more then just the theory you will have to know. This kind of reminds me of a boss at my previous job, he knew minimal programming but was more so into business/marketing aspect. He understood exactly what to do and how things worked, just not how to turn his ideas and concepts into actual code. I would definitely recommend becoming familiar with a popular framework first. -
Suggestion: [PHP] [/PHP] Tags
Maq replied to DarkSuperHero's topic in PHPFreaks.com Website Feedback
I don't like using them anyway. It's OK for a line or two, but when you "select all" from a decent size piece of code, and paste it in your editor it creates extra line breaks everywhere. -
SELECT * FROM table ORDER BY FIELD(field_name, 'Beans', 'Lettuce', 'Chocolate', 'Onion', 'Milk') DESC;
-
[SOLVED] Variable name from For Each $_POST command
Maq replied to NickG21's topic in PHP Coding Help
Will create the variable name with the value of $key and assign it to the value of $value. Notice the double '$', make sense? $$key = $value; So if you do this after the loop: echo $ShipCuFName; It will output "nick". -
[SOLVED] PHP Division rounding to 2 decimal places?
Maq replied to Padgoi's topic in PHP Coding Help
number_format EDIT: Better yet, you can use money_format. -
You can manually do it in PhpMyAdmin.
-
Please make an attempt yourself, no one is going to do this for you... If you just need the SQL help, because you DID post in the MySQL forum, you need to use INSERT for the registration and to check when the user logs in you need to use SELECT and see if the credentials are correct by checking if the query returned any rows.
-
Then you better get crackin. Have you tried this?
-
You must really think you're an empress, little jackanapes...
-
Works for me. Are there certain ones/combinations that don't work?
-
I hope points is an INT... SET points=points + 25
-
You need to use some sort of loop from your query to create the table and insert the values. i.e. </pre> <table border="1"> Week Planned Hours for($i=0; $i{ ?> hours } ?> </ You're also going to need to change your query to select all the planned hours for each week (take out the where condition).
-
Something like this? A user can enter a number in the next field (week) and it will submit to the same page to check the database. if(isset($_POST['submit'])) { $week_1 = $_POST['week']; // Make a MySQL Connection mysql_connect("xxx", "xxx", "xxx") or die(mysql_error()); mysql_select_db("xxx") or die(mysql_error()); //Getting specific information the database //database = david_weintraub //column = planned_hours //row = $week_1 $p_1_f="SELECT planned_hours FROM david_weintraub WHERE week='$week_1'"; $p_1=mysql_query($p_1_f) or die(mysql_error()); $p_1_row=mysql_fetch_assoc($p_1); echo $p_1_row['planned_hours']; } ?> </pre> <form method="POST" action="<?php%20echo%20%24_SERVER%5B'PHP_SELF'%5D;%20?>"> <
-
You're Welcome.
-
Lol, next time you have problems and can't figure it out what's going on, you can enable heavy error reporting right after your opening <?php tag to rule out 'simple' mistakes. ini_set ("display_errors", "1"); error_reporting(E_ALL);
-
Or problems YW, good luck!
-
You need to change the function name, print() is a native function in PHP.
-
Please refer to the manual next time - date. The date() function takes in a format string and an optional timestamp (which is what you have). BTW, the strtotime isn't necessary.
-
Are you supposed to let the user choose a week? How are you supposed to know what week it is? The reason I'm asking is because if you're hard-coding $week_1 to '1', then you mine as well just hard code it in the file you perform the query...
-
I assume these are 2 separate tables? I don't believe you'll need to join them. You can just check the classified type from the first table and determine the page to call from that. Here is some testing code I wrote, I hope it gives you an idea of how to pass variables within the same page using the $_GET method. Please read more here - GET. You will need to retrieve the id from the link, by passing it via http (get method) and perform a query, matching the id, check what the type is, compare it to the switch statement, then proceed to include that screen in your page. Let me know if you have any questions: $callPage = "default"; $id = $_GET['id']; echo $id; $typeArr = array("AUTO", "BIKE", "PETS", "JOBS"); /** You're going to have to query the database for the type like this: $sql = "SELECT cls_type FROM table WHERE id = '$id'"; $result = mysql_query($sql) or die(mysql_query); $row = mysql_fetch_assoc($result); $num = mysql_num_rows($result); $type = ($num>0) ? {$row['cls_type'} : "default"; **/ switch ($id) { case "AUTO": $callPage = "auto.php"; break; case "BIKE": $callPage = "bike.php"; break; case "PETS": $callPage = "pets.php"; break; case "JOBS": $callPage = "jobs.php"; break; default: $callPage = "default.php"; break; } ?> These are your records: echo "Requiring page: $callPage "; //Instead of echoing it you should use require_once($call_page) foreach($typeArr as $arr => $value) echo "Record $value "; ?>