Jump to content

Boo-urns

Members
  • Posts

    144
  • Joined

  • Last visited

    Never

Everything posted by Boo-urns

  1. Now if you want to match it via next week or any given possibility Next Thursday etc... use strtotime http://us3.php.net/strtotime
  2. So what is mandatory for the search form? Basically what you'll need to do is setup checks when you parse the data inputted. And set up a search based on that.
  3. I wouldn't necessarily sign a specific row to a page as you might change it delete it etc in the future. That is where the 'page' field comes in hand so you would sort via that page. ("WHERE page='home'") You can setup the page field as the same name as the end of your URL with $_SERVER['PHP_SELF'] or you can do it manually on the page. (ie. 'home') Are you already using a templating system or a cms already setup? Yup, of course you can get it setup with the images as well. There are a few ways to do that as well. If you don't have more than say 2 images I would put it in the same table. (image1 | image2) Then if you don't have a picture but there is always a space for it i would create a div for the image section and a div for the text section. Or you can just put the image on the page and float it with some padding so your text will wrap. Hope that helps some more!
  4. Are all the pages just static at the moment? I would create a table describing what you're editing. So from first glance here is how I would set it up. (with just field names for now) id | page | section | sectionTitle | description | viewable page = what page you're on 'homepage' sectionTitle = 'who we are' etc... description = your text viewable = you can flag on or off the section if you want that functionality. It is possible to keep the formatting the same either if you know how to already put it together, something like fckeditor, or what is very easy to setup is textile. I hope that helps you out.
  5. Well If the data is being submitted via ajax, wouldn't you set up the form so when the user clicks next it just shows the next part of the form? Essentially being the same form? Or will the data be submitted via $_POST on submit instead of using ajax for the form?
  6. A combination of sessions and queries is the way to go. When logged in start a session and create session variables. I setup userID, and whatever other variables will need to be read frequently. Then on a page for your facts check the session variable and pull information from that.
  7. Isn't that the same code as previous? I believe someone recently said it was working. It looks like a great script! I would change your mysql_real_escape_string to mysqli. That's my suggestion anyway. http://us.php.net/manual/en/mysqli.real-escape-string.php
  8. Wow I didn't realize prepared statements are auto escaped! Thanks for the links as well!
  9. So MySQLi protects against that then?
  10. Hmm UNION didn't cooperate for me. The way I got it to work is I checked if their is any data in the 3 tables had a switch statement to create the queries correlating to it. Might not be the best way but it's working.
  11. Alright thanks for the tip i'll look into UNION
  12. Any idea where I've gone wrong w/ my LEFT JOIN? Or would you suggest multiple queries?
  13. I'm joining the tables for a query I need to pull for the users. (I'm not sure why you suggest to use navicat for that.) I have navicat but just use it to browse search the db.
  14. What i'm trying to do is join multiple tables together (3 tables) I can get it to work fine if a user has data in all 3 but how would you go about it if there was only 1 table or 2 tables with the data? "SELECT * FROM magazine_reviews LEFT JOIN (book_reviews LEFT JOIN poem_reviews ON book_reviews.userID = poem_reviews.userID) ON magazine_reviews.userID = book_reviews.userID OR magazine_reviews.userID = poem_reviews.userID WHERE beer_reviews.userID='$id' Any ideas? This will work fine if there is data in all 3 or even if its just in magazine_reviews. Thanks for your help
  15. alright got it fixed! It doesn't like it setup the standard way have to use advanced.
  16. Is the " $cell['class']" is that your div class? What does the views_css_safe function do? I'd check all of those functions out and see where the divs and everything are produced.
  17. I've set up a few crons before but have never come across this error. Any suggestions? /home/myusername/public_html/scripts/php/cron-bar-rank.php: line 1: ?php: No such file or directory /home/myusername/public_html/scripts/php/cron-bar-rank.php: line 2: syntax error near unexpected token `$_SERVER['DOCUMENT_ROOT'].'/scripts/conn.php'' /home/myusername/public_html/scripts/php/cron-bar-rank.php: line 2: `include($_SERVER['DOCUMENT_ROOT'].'/scripts/conn.php');' and here is the php file. <?php include($_SERVER['DOCUMENT_ROOT'].'/scripts/conn.php'); // i've tried changing it to conn.php and threw it in the same folder as the cron script still no luck // i've tried just copying the connection info onto the page no luck again Thanks in advance! -Corey
  18. I'm going to take a stab since I don't have IE6 available at the moment. Try taking out the "new_item_image" div see what that does.
  19. Wow what an embarrassment :-/ thanks for spotting it
  20. genericnumber1 - can you somewhat describe dependency injection? I've found an example but I'm having problems creating it to work. I'm getting an error: "Fatal error: Call to undefined method BookReader::getChapers()" Which i imagine is the DI not working. <?php interface Db { public function executeSql($sql); } class MySqlDb implements Db { public function __construct($username, $password, $host) { // i took out the constructor and used the mysqli constructor } public function executeSql($sql) { // return something here nothing new... } } class BookReader { private $_db; public function __construct(Db $db) { $this->_db = $db; } public function getChapters() { return $this->_db->executeSql('SELECT name FROM chapter'); } } $book = new BookReader(new MySqlDb(DB_USER, DB_PASS, DB_HOST)); $chapters = $book->getChapers(); Instead of using an interface i just extended the mysqli class for MySqlDb. I just can't wrap my head around this yet :-/
  21. Validate user logins, or should that be under a User class? What do you suggest?
  22. I am thinking of having a few classes for different sections / events for a site. First off I have extended mysqli class. Now where I am confused is I have a class for validation (passwords, zipcodes...etc) Is it best to have a db connection there as well or is there a better way of doing that? Thanks!
  23. I resorted to trying it out not in the extended class and straight from the mysqli class. That did show errors and I had an error in the query. I did get it fixed in the class though with this: <?php if (!mysqli::query($insert)) { printf("Errormessage: %s\n", $this->error); } For some reason it wouldn't recognize the mysqli parent class.
  24. I believe the first way was correct as since it is in the class you can't call it the straight up object way. Parse error: syntax error, unexpected T_OBJECT_OPERATOR
  25. Yea it does spit out an error: Fatal error: Call to undefined method mysqli::error()
×
×
  • 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.