Jump to content

cpd

Members
  • Posts

    883
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by cpd

  1. cpd

    left join

    You can use reserved words, just make sure you wrap them in slanted apostrophes. There's no need for you to have a full stop at the end of each line either. $sql = "SELECT `OUT`.`Employer`,`OUT`.`DVD_ID`, `Location`.`L_ID` FROM `OUT`, `Location` WHERE `OUT`.`DVD_ID` = `Location`.`L_ID` AND `OUT`.`Employer` = '{$Account}'"; If your not getting any results ensure a result set is being returned and no errors are occurring with the mysql_errors() function. If everything's fine, you probably don't have any results matching that query. Moreover, with joins such as these you can easily get ambiguity so be careful.
  2. Just because you've written code to show information, it doesn't mean it will. There are various problems which could arise such as no results being returned from your query... Ensure you're getting the expected results by dumping the information; if not there may be something wrong with your input. Work out the problem and go through your script piece by piece killing it at certain points to ensure its getting past specific if statements etc. You can also set your error reporting to all using the error_reporting(-1) at the top of your script.
  3. I'm failing to see your pattern? As far as I can tell your decreasing the DD by three for every month starting at a specified date but when you hit August (08) that pattern completely flops...
  4. $this->two(); self::two(); $this->three(); self::three(); The "$this->" is a dynamic call and the "self::" is a static call.
  5. Your query still includes $companies. Is this meant to be a table or a variable?
  6. I think Thorpe, by web path he means the http root.
  7. I get the feeling it might be something to do with your database and you not actually getting any information. Can you run a few checks to ensure your actually getting the expected results and confirm the userid is being set inside login.php with a die function or something.
  8. Are you sure your even reaching main.php?
  9. You can look into adjusting your ini files include_path option. http://uk3.php.net/manual/en/ini.core.php#ini.include-path
  10. You should be able to setup a trigger and send the information across to the other server.
  11. I can't see you uploading the file anywhere in your script. Take a look at the move_uploaded_file() function here: http://www.php.net/move_uploaded_file
  12. cpd

    PDO PHP

    Your not evaluating it as a function, your evaluating it as a variable (property). $st->execute; Should be $st->execute();
  13. You wouldn't be able to remove the class like that with jQuery because its not a class. Its a style for the tag itself.
  14. Just to clarify, I didn't mean you require IIS for SQLSRV. I meant if your using a Windows Server you will most probably end up using an IIS server as very few hosts offer Apache in a Windows platform. Additionally, I would heed Muddy's Access -> Bonfire suggestion. Microsoft have been trying to dump Access and replace it with SQL Server Express for a number of years now; due to SQL Server's complexity Access is still taught in Colleges and Universities which results in many people sticking with it. The power of SQL Server is far greater then Access so I would definitely convert.
  15. $query = mysql_query("SELECT * FROM news WHERE `ref` = '$last'"); This is where your error is. Ensure everything is spelled correctly etc.
  16. function __autoload($class){ include_once $class.".php"; } However, the autoload function may be depreciated in future versions of PHP as mentioned on the PHP website (www.php.net/autoload). I'ts better to define your own function and register it as an autoload function; also explained on the same page.
  17. Just to reiterate what requinix is saying. SELECT (concat(TIMESTAMPDIFF(DAY, AVG(), NOW()),' day(s) '
  18. Provided you have no referential integrity you can do something similar to the following. DELETE b FROM mot.mot9_member_on b INNER JOIN 33080_cdr.mt_1201 a ON a.mobile_no=b.mobile WHERE a.dn_status='psanumberbarred' Consider renaming your databases, tables and fields with more descriptive titles as well. Currently, it is very elusive and unmemorable.
  19. If you want to omit user ID 1 by using the "continue" statement you should test if it is equal to one, not if it is not equal to one. if(user[userID] == 1) continue;
  20. Thank you for pointing that out, was a typo. I just copied his code as you can see and made a few quick adjustments. Regarding your second statement, there's no reason not to loop through the data as per the example. From what I understand his issue is, the example is a logical solution.
  21. You can't use just PHP to update information on a page. You need to use JavaScript, more specifically XMLHttpRequest; this is all summed up with the term AJAX.
  22. require_once('connections.php'); mysql_select_db($dbname, $db); $result2 = mysql_query("SELECT * FROM table WHERE image IS NOT NULL LIMIT 6"); $storeArray = Array(); while ($row2 = mysql_fetch_array($result2, MYSQL_ASSOC)) { ?> <div class="slide"> <div class="slidePromo"> <div class="promoImg"><a href="#"><img src="<?php echo $row2['image'];?>"/></a> </div> </div> <!--end slide--> <div class="slidePromo"> <div class="promoImg"><a href="#l"><img src="<?php echo $row2['image'];?>"/></a></div> </div> </div> <!--end slide--> <?php } ?> No idea why you've got multiple queries and then putting it into an array. Either way that should sort your issue...
  23. You login to your computer using a username and password. You access your emails using a username (email) and password. The same principle applies to a MySQL Server. You login with a username and password, then you can access the data (provided there are appropriate permissions).
  24. <?php include("../includes/xxx.php"); $cxn = mysqli_connect($host,$user,$password,$dbname); $query = "SELECT DISTINCT `plant_id` FROM `plant` ORDER BY `plant_id`"; $result = mysqli_query($cxn,$query); while($row = mysqli_fetch_assoc($result)) { extract($row); $selected = ($plant_id == EXPECTED_ID ? "selected='selected'" : ""); echo "<option value='$plant_id' {$selected}>$plant_id</option>\n"; } ?> Obviously replace the EXPECTED_ID with whatever your selected plant ID should be.
×
×
  • 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.