Jump to content

jdavidbakr

Members
  • Posts

    271
  • Joined

  • Last visited

Everything posted by jdavidbakr

  1. I like the sound of both. lol. I am doing the website for different "regions" of the country, so one region sees other "button" than another, etc. So it would be good to do: Region A sees buttons A,B,C Region B sees buttons 1,2,3? That makes sense. It pretty much boils down to coming up with a schema that fits your requirements. If each user has a region value in their table, then you just link the regions to the buttons that they see and you should be good to go.
  2. I think requinix is right - there are two values you need to change in php.ini: upload_max_filesize and post_max_size
  3. Depending on what level you need to control it, you probably will need to make a table that defines what buttons each user sees. Then do a select from that table to get the buttons (using the logged in user_id), and iterate through the result set to draw each button. If your buttons table had three columns - user_id, link, and button_image, you could draw it with something like this: $statement = "select * from buttons where user_id = '{$login_id}'"; $result = mysql_query($statement); while ($row = mysql_fetch_assoc($result)) { echo '<a href="'.$row['link'].'"><img src="'.$row['button_image'].'"></a>'; }
  4. Also ... you might change your query to: $query = "SELECT * from hours WHERE member='$user'";
  5. Something like this? Assuming the link column contains your e-mail address (since you don't have an e-mail column defined) insert into Classified select NULL, user, description, 'email2@hotmail.com', img1, published where link like 'email1@hotmail.com' The NULL for the PK will put in the next auto-increment value, the other columns will be filled by the matching rows except for the 4th (link) which will be replaced by the new e-mail address.
  6. Are you wanting to use LEFT JOIN instead? That will find the match in the Members table and then join the other two tables, leaving their columns NULL if there is no match. You should also join against the foreign keys instead of putting the constant in each join. Assuming m_id is the Member table's primary key: SELECT * FROM Members LEFT JOIN MemberMartialArts on MemberMartialArts.mma_memberId = Members.m_id LEFT JOIN MemberAbilities on MemberAbilities.ma_memberId = Members.m_id WHERE Members.m_id = '$memberId'
  7. On that note, most ISP's block port 80 inbound anyway.
  8. You're also using "=" and not "LIKE" so the query is going to be case sensitive. I.e, a search string of "john doe" will not return a row with "John Doe" Without seeing the actual query and the row you're expecting it to return it's hard to give many more suggestions.
  9. I meant to echo out the actual query, i.e. "SELECT * FROM Accounts WHERE FullName='John Doe'" where you can see exactly what the query is that is not returning the results, and enter that into phpMyAdmin to see why you're not getting any results.
  10. Must be a difference between the Windows and Linux versions of php, I get: $ php -r "echo date('r', strtotime('first day', 1291064453));" Tue, 30 Nov 2010 15:00:53 -0600 php 5.2.13 on Linux I don't know what I would expect 'first day' to return, and don't see an official list of commands in the strtotime() manual page.
  11. Why do you want to do that? It would make more sense to do a join instead of storing the same data in two tables.
  12. First, sanitize your inputs. Second, try echoing the statement and also echo out mysql_error() to make sure you're not getting an error.
  13. The easiest might be to put the three dates into an array as timestamps and sort the array. Then you can just implode that array for your output.
  14. Maybe just echo date('m/1/y', 1291064453);
  15. Try date_default_timezone_set() to change your script into your own time zone. Great tutorial on working with dates and times here: http://www.phpfreaks.com/tutorial/working-with-dates-in-php
  16. Are you sure you're getting a row in your query? Try echoing the query right after you compose it and double-check it by copying it into phpMyAdmin.
  17. Depends on what all you need it to do - but yes, that's likely what you'll want to do. You can have the enddate field set to NULL if there is no range. I did a calendar app once that had events on a day or a range of days, and did just that - if the end date was null, it was on a single date, otherwise it spanned from the start date to the end date.
  18. Assuming $row['duedate'] is a DATE or DATETIME format: if (strtotime($row['duedate']) < strtotime("+10 days")) { ... }
  19. If you look at the source code you'll see that it's printing "Copyright © <?php echo date("Y"); ?> - The Veitch Law Firm – All Rights Reserved" - which means that the page is not being parsed as PHP. Either the functionality is disabled on your server, or you might need to try one of the other methods on that link I sent.
  20. Ah, you're wanting to force the html page to parse as php? You can do this in .htaccess, yes, add this line: AddType application/x-httpd-php .html If that doesn't work, here's a handful of other methods: http://www.velvetblues.com/web-development-blog/how-to-parse-html-files-as-php/ This will make the server treat any file with the .html extension as if it had the .php extension.
  21. If you want to send the server's date in an html page, it has to happen as you create the html on the server. You can't instruct the client to do this with an html tag.
  22. You're missing a closing ")" in your call to hvataj()
  23. Wasn't too noticeable on my FF on OSX. Any reason you're using a php file for the css? It's possible that since it's a php file there may be some disabled caching where it's fetching the stylesheet on each page load. It could also be that it's taking just enough time to draw the stylesheet in php that firefox is displaying the page before it's completely received the stylesheet, while the other browsers are waiting to show anything until they finish loading the stylesheet. (Those are guesses, I don't know if any of those thoughts have any element of fact to them but they sound good)
  24. You'll need to have either a separate form for editing or modify your form to include a way to look up the current information. You need to tell the form which row you're editing, so you might put it into the query string, something like form.php?id=15 - and then as you build your form, retrieve the row with id 15 and use those values to populate the form. You also might want to include a hidden input type to store the ID, so when you process the submission you know whether you are editing an existing row or adding a new one. As for styling in the database, if I understand your question, you don't do any styling in the database. As you draw the page that has the info in the database you style it using the html/php code. The data in the database is just that - raw data.
  25. Are your dates being stored as a numeric or string type? I think if you're using something like VARACHAR 26 will come before 8 (because it's sorting by character, not number). Change your row to something like TINYINT and it should sort as you expect.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.