Jump to content

trq

Staff Alumni
  • Posts

    30,999
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by trq

  1. This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=355345.0
  2. Did you read PFMaBiSmAd's last couple of replies? Your database and code needs to be completely refactored.
  3. Hello from the other side of the country, oh, and welcome to the boards.
  4. Do you really think people want to go through all your code looking for your issues? Narrow your problem down to a specific piece of code and a specific question.
  5. Some code would be useful. Though these errors look like they are generated by HTMLPurifier itself.
  6. You should have PHP output the online users dynamically, thre is no need to actually create any html file.
  7. You never actually call the function, or echo any results.
  8. It looks like it's connecting to the database or you would see your error messages. You are however assuming that your query succeeded without checking it. Try: if ($result = mysql_query("SELECT * FROM tablename")) { // Query database if (mysql_num_rows($result)) { while($row = mysql_fetch_array($result)) { // Loop through results echo "<b>" . $row['id'] . "</b><br>\n"; // Where 'id' is the column/field title in the database echo $row['location'] . "<br>\n"; // Where 'location' is the column/field title in the database echo $row['property_type'] . "<br>\n"; // as above echo $row['number_of_bedrooms'] . "<br>\n"; // .. echo $row['purchase_type'] . "<br>\n"; // .. echo $row['price_range'] . "<br>\n"; // .. } } else { // no records found by query. echo "No records found"; } } else { // query failed, handle error trigger_error(mysql_error()); }
  9. __construct(). You should probably become familiar with how classes and objects work in PHP before using any framework. http://php.net/oop5
  10. I assume you have a primary key? You should seriously consider looking into database normalisation. Anytime you have fileds named foo_1, foo_2, foo_3 etc etc or any type of patterns like that wreaks of poor design.
  11. trq

    Shoot me.

    You have single quotes in a single quoted string. This logically makes no sense because php sees your inner quote as the end of the string. echo '<td><a href="documents/' . $row['Uploadedfile'] . '"><img src="/images/folder.png"></a></td>'; If you get yourself an editor with syntax highlighting these simple mistakes will stand out like tits on a bull
  12. Sorry but your code is unreadable with that kind of indentation. Anyway, you cannot have if statements in the body of a class like that. You'll need to move all of your logic into your __construct() if your plan is to conditionally assign values to an array when the object is created.
  13. I mean't via my package manager.
  14. You need to pass the data a user submits through the form into a WEHRE clause in your query. Other than that, yeah, that is one way to display results from a database query. It's not the cleanest of most common way however. Take a look at mysql_fetch_assoc and the examples of it's usage.
  15. If you echo the result of an include 1 will be displayed if the include executes successfully.
  16. I don't understand the issue. You can use a simple if statement.
  17. There would be literally thousands of tutorials around that show you how to display data from a database. ANyway, why not make a start by simply posting a search term to a php script and have the php script send that term to the database? See if you can get some results in an array. Once you have that, see if you can loop through that array and display it's data on a web page.
  18. From the looks of your questions I would say very. If you have done a login system then you have already worked with forms and databases (hell, you've even had to search the database for a specific user already). Why not try and apply that same knowledge to a different problem?
  19. We are not here to write code for people. Be specific with your issue and you will get *help*.
  20. Mobiles use browsers that are not too different from that of the desktop.
  21. Your $str variable is not valid, you should be getting a parse error. $str = "<i><font color="800080"> man </font></i><p><font color="9898989"> hi </font></p><p><font color="1111111"> cheers </font></p>"; Needs to be.... $str = "<i><font color=\"800080\"> man </font></i><p><font color=\"9898989\"> hi </font></p><p><font color=\"1111111\"> cheers </font></p>"; You don;t need addslashes at all.
  22. https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/isNaN
  23. This topic has been moved to Application Frameworks. http://www.phpfreaks.com/forums/index.php?topic=355229.0
×
×
  • 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.