Jump to content

Adam

Moderators
  • Posts

    5,717
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Adam

  1. With that he means that if you had purchased some web space off a company and they provided your PHP / MySQL .. In that case you could contact them to get the login name, but with what you have installed I can't see no reason why it wouldn't be root at all... ? Does it not work? Adam
  2. I've come up with a soloution using PHP, but I'd still like to know if there is such a thing in MySQL? would make the code a little nearer, and may help me on another project... $resSQL = "SELECT * FROM reservations WHERE (datefrom BETWEEN '{$year}/{$month}/01' AND '{$year}/{$month}/{$daysInMonth}')"; /* If ALL sites selected do not specify site in query */ if ($site != 'ALL') $resSQL .= "AND site = '{$site}'"; Cheers, Adam...
  3. Sure.. $resSQL = mysql_query("SELECT * FROM reservations WHERE (datefrom BETWEEN '{$year}/{$month}/01' AND '{$year}/{$month}/{$daysInMonth}') AND site = '{$site}' ORDER BY datefrom ASC") or die(mysql_error()); That's the query I'm using. Most of it doesn't really matter right now except "AND site = '{$site}' " .. I have a drop down menu that allows them to select site 1, site 2, site 3, etc. the sites are stored in the database by IDs .. so the value of $site would equal 1, or 2, or 3, etc. except there's an option for ALL, so I was wondering if there was some special operator or something I could enter in the $site variable in order to - in english - return records with 'site' field equalling anything. Any clearer?? Thanks! Adam
  4. Hi guys. I was just wondering if there's some kind of operator or something that can mean the field can equal any value? Basically I select records based on the 'site', but there's an option for all. So without having to go.. if ($site = 'all') //run this query else //run this query I could either have it return records from site 1, site 2, etc. or have it return records with any value for site.. Hope that makes sense?? Cheeers, Adam...
  5. Well because you're echoing out the $text variable you can't just return the value at the end. You could try saving the outputs into one string, or an array, and then return that? To return a value simply add "return $varname;" to the end, or wherever in the function. The function will stop when it reaches return... Then you'd use something like: $text = edit($id); Adam
  6. Well there's no way to have two records with the same unique ID. Some are just going to have to change? Adam
  7. Perhaps the problem... echo $row['columnName']; ...did you replace "columnName" with an actual field name from your table? Adam
  8. Okay try checking if there's an error with the mysql: $Num = mysql_query("SELECT * FROM `users`") or die(mysql_error()); $Num = mysql_num_rows($Num) or die(mysql_error());
  9. I tested it without the MySQL and it worked fine, I can only imagine its either that or you don't have the GD library installed on your version of PHP, is it a free host you use? Adam
  10. Okay firstly, just as a heads up you don't need... <?php include_once('includes/header.php'); ?> <?php include_once('includes/menu.php'); ?> <?php include_once('includes/side.php'); ?> <?php if (isset($....... you can just use... <?php include_once('includes/header.php'); include_once('includes/menu.php'); include_once('includes/side.php'); if (isset($........... ------------- Try adding some static text to the echo to see if it it's something to do with setting up the array.. like... if(array_key_exists($_GET['pg'], $breadcrumb)){ echo 'Breadcrumbs: ' . $breadcrumb[$pg]; } else{ echo 'This breadcrumb does not exist'; } Adam
  11. Not sure why your so stressed out about it? And no, not a foreach loop.. not sure wether you require the DThreads function to be seperate? But that could easily be added to the DisThread function, which itself could be cut down to far less lines.. for example: function DisThread() { $tt = mysql_query("SELECT * FROM Threads") or die('SELECT Error: ' .mysql_error()); $count = mysql_num_rows($tt) or die('COUNT Error: ' .mysql_error()); while ($Thread = mysql_fetch_assoc($tt)) { $this->DThreads($Thread); } } Adam
  12. Not according to many articles I've read.. include should throw a notice, but require should cause an error... http://discomoose.org/2006/04/28/the-difference-between-require-and-include/ Just an example from one of the top results off google... Adam
  13. Yes you need session_start(); on every page you use sessions... Adam
  14. Do you have error reporting switched off at all?
  15. what happens in header.php? Basically you're setting the PHP file to display as an image, so you'd just use something like: <img src="your-php-file.php" /> You can't print out any HTML in the page though otherwise it won't work! Adam
  16. http://us.php.net/manual/en/function.imagestring.php Adam
  17. Sorry mate but that doesn't make much sense to me. From what I can understand, you're going a hell of a long way round to do simple things. I'd suggest rewriting them in a simpler, clearer form and then debugging any errors. An example of what I'm talking about is in the DisThread function; you're running a query to select all the thread IDs.. counting up the results.. then using a for loop to perform a query for each thread, to then pass the array onto the DTThreads function, when you could do all that in one function, with far less code and only one query! Adam
  18. Think Mchl has it! Reckon you might want to look into some security aswell by the way! Adam
  19. But people are trying to help you now? Can't because we can't actually help you find the problem... Often when I've been trying to find a problem for a long time, a break or a fresh pair of eyes helps you find it much faster... Adam
  20. Have you tried adding.. or die(mysql_error()); to the end of your queries, for example: $threads = mysql_query("SELECT * FROM threads") or die(mysql_error()); that should output any MySQL errors... Adam
  21. well i sort of get you, but what date will be stored in date? yesturday, today? could try something like.. SELECT max(xpField) FROM tableName WHERE dateField = 'someDate' Never really used max before though, mentions a lot about grouping the results, could try using it...
  22. Not amazing with regular expressions but could try adding.. eregi ($url, \^('http://') | ('https://') | ('ftp://')\) or... eregi ($url, "^('http://') | ('https://') | ('ftp://')") Adam
  23. From what I understand of servers, and i may very well be wrong, but to communicate with a server (or web server) you need to use TCP/IP protocols. Perhaps if you have the internet disabled you're also disabling the TCP/IP protocol, which then prevents you from communicating with the web server? Someone tell me if im wrong? Adam
  24. yeah, save the date field in your database as a "date" format .. and then use: mysql_query("SELECT * FROM yourTable WHERE dateField BETWEEN NOW() AND DATE_ADD(NOW(), INTERVAL 365 DAY)"); ... that's the way i use anyway... EDIT: Not massively experienced here so could be used with like 12 MONTH instead of 365 DAY ?? Adam
  25. okay, and your getting an error? what happens when you do use.. $content = '<table><tr><td><b><u>Name</u></b></td><td><b><u>Title</u></b></td><td><b><u>Level</u></b></td><td><b><u>Experience</u><b/></td><td><b><u>Gender</u></b></td></tr>'; print $content;
×
×
  • 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.