Jump to content

TOA

Members
  • Posts

    623
  • Joined

  • Last visited

Everything posted by TOA

  1. Close...change $approved = mysql_query("SELECT * FROM images WHERE approved"); to this: $approved = mysql_query("SELECT * FROM images WHERE approved=1");
  2. Double check that. If you search for test2 in your query, you won't return correct results. It only returns the right results if you use the first term with your query. I just created a table and tried it. You need a % in front too, like I originally suggested No, that should return the right results: anything with test1 in it
  3. So for each question, it will have 4 possible answers...if I'm understanding. And will these 4 choices be the same for every question? ex: 1. Ques 1 a. 1 b. 2 c. 3 d. 4 2. Ques 2 a. 1 b. 2 c. 3 d. 4 I have a db schema and code for you to base yours on, but would require you to change your db structure, to be normalized, like fenway said.
  4. Oh if you want an exact match, just use = WHERE Column_Name = "Search_Term" Is that what you need?
  5. You could do it in php, but mysql does have a where loop: http://dev.mysql.com/doc/refman/5.0/en/while-statement.html I think that's what you're looking for
  6. I think this is what you're asking for: http://dev.mysql.com/doc/refman/5.0/en/string-comparison-functions.html
  7. http://php.net/manual/en/function.in-array.php
  8. I do know what you mean. It's just something I thought he should consider and is just my opinion
  9. I respectfully disagree. Clients can alter they're javascript settings all the way to blocking them completely and then where are you? IMO js/jquery/ajax should only be used for 2 reasons: 1. to create a smoother user experience or cool functionality, but must have a way to gracefully degrade 2. when there's no other way The includes example QuickOldCar provided worked for me, so it must be an issue with the code This is true, but see above These are just my opinions and intended to give the OP something to think about
  10. That's a reasonable start, and I've done it like that, but follow the link in the sticky. There's an article that talks about fixing holes and whatnot...might be some usefull info that you can use for your purpose. Not sure what you mean Luck
  11. Writing cron jobs is relatively easy (for simple tasks). An afternoon of reading should put you in the right place.
  12. Without testing it, yeah it looks fine Don't use * though...it's good practice to name your fields implicitly And define your sql in another variable, it's cleaner and makes for easier testing like this: $sql = "Your sql"; $res = mysql_query($sql) or die(mysql_error());
  13. Read the Sticky: http://www.phpfreaks.com/forums/index.php?topic=125105.msg522853#msg522853
  14. I think your quotes are just wrong Try this: echo '<p><a href="'.$article_link.'">Read More...</a></p>'; or echo "<p><a href=\"$article_link\">Read More...</a></p>"; Either one should work...taking into account what HuggieBear said
  15. http://tinyurl.com/4gheumd love that
  16. Thanks, I really appreciate it. I just can't seem to get this right CREATE TABLE IF NOT EXISTS `Testimonials` ( `Testimonial_ID` int(11) NOT NULL auto_increment, `Testimonial_Name` text collate utf8_unicode_ci, `Testimonial_Text` text collate utf8_unicode_ci NOT NULL, `Approved` int(11) NOT NULL, PRIMARY KEY (`Testimonial_ID`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=27 ; INSERT INTO `Testimonials` (`Testimonial_ID`, `Testimonial_Name`, `Testimonial_Text`, `Approved`) VALUES (1, 'AS', 'This is a great program! Not only have I got my health under control, I finally got my finances back in order after my divorce. The classes and resources were extremely helpful. Thanks!', 1), (2, 'B.K', 'I''ve dropped 53 pounds since our company took on this program! I can''t believe it! All I needed was the knowledge..', 1), (7, 'Jill', 'I can not believe there is a place that offers this much help. Fantastic', 1), (9, 'Anonymous', 'Fantastic!', 1), (11, 'Anonymous', 'Can''t tell you how much this rocks!', 1), (12, 'GT', 'This has even helped my husband get control of his work environment!', 1), (20, 'Andrea', 'Wow fantastic I never thought improving my life would be so easy', 1), (21, 'Anonymous', 'Superb', 1), (25, 'Jennifer', 'Awesome program! I''ve got my friends using the tactics I learned also. This is great', 1);
  17. So far, I'm not getting anywhere. Is that all I would have to do is just move that from the beginning to the WHERE clause? I read up on it and I think I get the use, but I can't get the sql right Thanks
  18. Don't know much about derived tables (anything really). Guess I have another thing to look into. Turned into quite a learning task
  19. I'm not sure I get it. Can you elaborate? Thanks
  20. I'm curious, how would it affect the format in the database? Wouldn't it just switch mcdonald's to mcdonalds in the string to use in the match?
  21. CNT stood for count, which was the one alias you would use to echo it later, like: while ($row = mysql_fetch_assoc($your_result)) { echo "$row[CNT]"; } I said it would get you started. Just showing an example of the type of join you need. If you ran it with the category you wanted it would return the count. Loop it and you might be close. Try and then show us your code
  22. Ok, I'm trying to get up to speed with this. I see no reason the previous statement isn't working, but I havn't given up yet. I have a parallel question: I found this here (right after they talk about using CAST(), about 1/4 of the way down): Does this contradict you or am I taking it out of context? So here's the question resulting from finding that: Would setting the variable first in it's own query affect performance if the table gets really large and has alot of users?
  23. Actually, that's not working..going to keep trying
×
×
  • 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.