Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. Then why are you passing the whole query to your clean_sql() method? Change your query() method to public function query($sql) { $this->act = @mysql_query($sql, $this->con); if(!$this->act) { $this->err('MySQL', 'Database Query'); } $this->affected_rows = mysql_affected_rows($this->con); }
  2. You need to rethink how you escape data in your query. Currently you're passing the whole query to your query() method, which in turn passes the query to clean_sql() method which will escape all quotes in your query and not your queries values. You should escape all data before constructing the query itself.
  3. You have no commas separating your fields/values. This is because your clean_sql function removes comma's (and other required characters) from your query. This is the offending line: $string = ereg_replace("[\'\")(;|`,]", "", $string); I'd recommend you remove that line.
  4. You'll want to use a WYSIWYG editor such as FCKEditor or TinyMCE for what you're trying to achieve
  5. Um, your code will need to be mostly rewritten. You wont fix it by changing a single line, this is the problem with scripts which rely on register_globals.
  6. You wont be able to do that with out a form.
  7. Looking at your HTML source code the following is what contains your google map <table class="fullboxGmap" width="100%" cellpadding="3" cellspacing="1"> <tr> <td><div id="Gmap"></div></td> </tr> </table> Your should apply the css to the containing td tag I believe with IE, it'll collapse the boarders of a cell if there is not data in it. To prevent this you should add a single space ( ) in emtpy cells. I'm not sure about your third question as I only have IE7/FF3 installed.
  8. Use a normla link? <a href="page2.php?search=all>Search All</a> In page2.php use $_GET['search'] to retrieve the search url variable.
  9. should be if (isset($_POST['upload']) && $_POST['upload'] == "upload" && isset($_POST['superdat_name'])){ Try to avoid using $_REQUEST, as this variables includes _POST, _GET and _COOKIE data at the same time. You should instead use either $_POST, $_GET or $_COOKIE variables.
  10. This is is due to the way you check to see if your query return any results, the following code is the problem $result = mysql_query($sql) or die (mysql_error()); $count = mysql_num_rows($result) or die (mysql_error()); mysql_close(); $row = mysql_fetch_array($result) or die (mysql_error()); //if $dept_id is set then display the results if(isset($row['dept_id'])){ Each time you use mysql_fetch_array($result), it'll return a single row from the result set. As you have called mysql_fetch_array($result) this will return the first row from the result set, the when you get the while loop, only four results are displayed. The following is an example of how to check if any results are return from a query: $sql = 'YOUR QUERY'; $result = mysql_query($sql); // check that any results was returned // mysql_num_rows returns the number of rows returned from your query. if(mysql_num_rows($result) > 0) { // results returned, display results while($row = mysql_fetch_array($result)) { // do whatever } } // no results returned // display 'no results' message else { echo 'No results!'; }
  11. That will only work for classes not functions.
  12. To answer the question no. How would PHP know where the function is defined?
  13. When you start numbers with a 0, PHP thinks you mean octal notation.
  14. Use your class name instead, eg your_class_name::
  15. The problem is the div that contains each of your note/blog entries has a 12px margin on the bottom, this will cause your drop down container to not stick to the bottom of your notes.
  16. You can leave it as is. Many scripts allow you set prefixes for table names, eg dir_table_name. The table name is created by phpmydirectory.
  17. You cannot change environment variables (_ENV) via your php.ini. The _ENV variables are inherited from the system.
  18. Yes this appears to be happening. I have done some testing on this and my results are the same as yours. I cant find any information on why this happens
  19. Open up the command line terminal by going to Start > Run > cmd Now type the following command mysql -u YOUR_USERNAME -p and press enter (change YOUR_USERNAME to what ever your new user is). MySQL will then ask for the password. Enter your password and press enter. If successful you'll be logged in as the new user. NOTE: before using the mysql command you may have to navigate to MySQL's bin folder first, to do so run this command first cd C:\wamp\mysql\bin now press enter. The command prompt should now read C:\wamp\mysql\bin> Now run through the steps above.
  20. Yes as long as the PHP folder has been added to the PATH Environment Variable, which you have. Make sure Apache is stopped and open your php.ini and turn display_startup_errors on. Save the php.ini and start Apache. This time errors should be displayed when Apache starts up.
  21. I presume you could change <?php do { ?> <table width="50%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td class="style5"><?php echo $row_search['Description']; ?></td> </tr> </table> <?php } while ($row_search = mysql_fetch_assoc($search)); ?> to <?php if($totalRows_search > 0) { do { ?> <table width="50%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td class="style5"><?php echo $row_search['Description']; ?></td> </tr> </table> <?php } while ($row_search = mysql_fetch_assoc($search)); } else { echo 'No results forund'; } ?> However you'll be better of coding the script yourself, that way you know what is happening in your script. Letting Dreamweaver do it for only complicates things, as the generated code is messy and alot of is not needed. The above code could be written to around 10 lines max.
  22. When the Configuration File (php.ini) Path displays C:\WINDOWS it does not mean PHP is reading the php.ini from that directory. What it means is C:\WINDOWS is the last place PHP searches for the php.ini (PHP does search for the php.ini in three key places, the PATH, PHPRC and the system folder (C:\WINDOWS)). The line you should take notice of is the Loaded Configuration File line, this line should state the full path to the loaded php.ini. if it displays (none) then no php.ini is currently being loaded.
  23. By default PHP can consume up to 128MB, this can be changed from the php.ini (and/or your script) via the memory_limit directive. I do believe PHP has a built in function for seeing how much memory your script is using, However I cant remember the name of the function.
  24. The variables $user_name and $user_password will only be set if the query returned any results, How can PHP compare $_POST['txt_user_name'] to the $user_name variable if it doesn't exit.
  25. Do you mean the icons for the forums? - means there are no new posts - means there are new posts in the sub-forum(s) - means there are new posts. Edit (Daniel0): Fixing bbcodes
×
×
  • 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.