Jump to content

PFMaBiSmAd

Staff Alumni
  • Posts

    16,734
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by PFMaBiSmAd

  1. Just iterate over the $result array - foreach($result as $row) { // Retrieve data until no more // code to use the elements of $row goes here.... }
  2. You would use php's command line interpreter (CLI) - http://us2.php.net/cli
  3. What does var_dump($command_value); show?
  4. or you can use a .php file extension, but you need to output a correct Content-type: header at that start of the code in the file so that it will be treated as javascript.
  5. If you investigate the Window's scheduler menu choices, you will find that you can schedule a task to repeat every x minutes or every x hours.
  6. Have you confirmed that $LOMAKE2 actually has "etusivu" in it?
  7. Do you have a database connection so that mysql_real_escape_string would work? Also, why are you escaping data and then stripping the escape characters back out for data being written to a file?
  8. IF the two different databases have the same database user, the following query will get the records that have been signed in, but have not been signed out - SELECT * FROM sign_in.`customer sign-in` tin WHERE NOT EXISTS ( SELECT * FROM sign_out.`customer sign-out` tout WHERE tin.`Ticket #` = tout.`Ticket #` )
  9. ^^^ Is that an accurate statement? That would imply someone signed something in that is currently not signed out? How would a Ticket # even exist in this case?
  10. C) Actually, since $result holds the result of the array_diff_key statement, there's no likely reason to re-retch any of the data from the either query (you have freed up the result resources, so they don't exist anyway.) If you use echo '<pre>',print_r($result,true),'</pre>'; to display what the sample data is and state what output you need from the data, someone can probably help.
  11. A) If you have a specific reason for using two databases (or any other conditions you are aware of that defines a problem you are asking someone to help you with), stating those at the START of a request for help or putting a comment in the code you are posting would be prudent. B) If these two different databases are on the same database server and are accessible by the same database user, you can specify the database name and table (the format would be db_name.table_name instead of just table_name) in your queries and it's possible to write one query to do what you are trying to do.
  12. You are using mysqli for your database functions. You cannot use any of the mysql_ (non-i) statements. You would need to use the mysqli fetch_assoc method or function. Edit: Also, why on earth do you have related data in two completely separate databases?
  13. file_exists expects the file system path/name to the file. It only works with a URL using a couple of protocols and the http protocol is NOT one that it works with. You would need to use file_exists on the path/name to the file before you form a URL from that path/name. If the code I suggested actually formed a table with a row for each image but didn't display the images, then the actual path to where the images are at and where your script is running at it isn't what you implied in the $url value you showed in the initial post.
  14. You are only executing the last query, the one that sets `pricerange` You only have one mysql_query() statement and it executes the query that is in $query. You should be forming one query that updates all the fields at one time, not a separate query for each field.
  15. If you state your overall goal with an example showing what you are starting with and what the end result should be, it will often lead to the best solution. I can easily imagine you can do whatever it is you are actually trying to accomplish inside one query or using one preg_ statement.
  16. Or simply - <?php $files = glob('images/icon_*_64x64.jpg'); foreach($files as $file){ $url = "http://localhost/$file"; echo "<tr><td><img src='".$url."' /></td></tr>"; }
  17. Use glob to get a list of the images into an array and then simply iterate over the elements of that array and output the links/<img > tags for each image.
  18. SELECT * FROM `reminders` WHERE member_id={$_SESSION['SESS_MEMBER_ID']} AND reminderDate BETWEEN CURDATE() AND CURDATE() + INTERVAL 7 DAY
  19. Since you have a DATE data type, why don't you just write a query to match the rows that you want? Mysql has a couple dozen date functions that make using dates easy.
  20. If you post the code and the error message, someone can probably help you with the problem.
  21. The blank page is because your form's submit button is named "Submit" name="Submit" The php code would need to test for that same name. You are currently testing for $_POST['submit'], which does not exist and the code is being skipped over.
  22. The HTTP protocol requires that HTTP headers be sent to the client/browser before any CHARACTER gets sent. Something in your linkmysql.php file on or up to and including line 2 is sending one or more characters to the browser. You are also going to find that near the end of the code you posted, that all the white-space (tabs, new-lines,...) after the closing ?> tag up to the <?php tag on the next line is output that will prevent the final header() redirect from working. The reason your code worked on your development system is because php thought it would be a good idea to 'help' beginning coders write code that 'worked' that they could turn in for assignments over writing code that is correct and will work in real live on all server configurations. Your development system has output_buffering turned on in the master php.ini. That allows code to improperly send output to the browser (it gets buffered instead) before sending a http header. If output_buffering is ON, on your development system, turn it off so that the code you develop will work on the widest range of server configurations and you won't waste any more time developing code that might be suitable to turn in as an assignment but won't work when you put it onto a server that is not under your complete control.
  23. Unless you are using php as an Apache Module or using 3rd party (non-php.net provided) extensions, there should be no problem using the latest php.net Windows binaries. From php.net - If you are using php as an Apache Module, you can obtain a VC9 build of Apache2.2 at ApacheLounge (simply copy the VC9 files over your existing VC6 Apache2.2 files, taking care not to overwrite your existing httpd.conf configuration or any vhosts .conf configuration files.)
  24. ^^^ That's not the 'view source' of the page in your browser. The reason for asking for that is so that all the characters and tags present will be displayed.
  25. I have no way of testing this, but in Acrobat, where you created the PDF form -
×
×
  • 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.