Jump to content

jazzman1

Staff Alumni
  • Posts

    2,713
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by jazzman1

  1. He-he.......yeah....but with examples
  2. Basically, I would say the same as AdrianBV's post above. if these updates not happened every minute, hour or day, you could create a second table which may look as the master one or just replicate the columns name that you need to use for yourself. For example: CREATE TABLE replicate_master (id, author_name, author_text) Then, whatever you need to update the table, you could run the following query: REPLACE INTO `replicate_master` SELECT `author_name`, `author_text` FROM `master_table` GROUP BY `author_name` Later, create a cron job, which it runs on a schedule basis and execute this query from the shell using the command-line client with the "-e" flag. It would be something like: /usr/bin/mysql -h "db_server" -u "db_name" -p "db_pass" --database="db_name" -e "REPLACE INTO `replicate_master` SELECT `author_name`, `author_text` FROM `master_table` GROUP BY `author_name`" If these updates happen every minute or less you can execute this "REPLACE INTO" statement before someone try to update some values in this table. REPLACE INTO `replicate_master` SELECT `author_name`, `author_text` FROM `master_table` WHERE `author_name` = '$author_name' GROUP BY `author_name`
  3. Make checkboxes to be optional.
  4. I already told you how! Check out my echo's.
  5. What's the extension of the file? It's php or something else?
  6. Debug your xml data outputs and turn on error_reporting on the top of the file: This is wrong php syntax - echo $Year $Make $Doors $Model; Use code tags in the future! Try, (uncomment my echo's) <?php error_reporting(-1); if (file_exists('File.xml')) { $preowned = simplexml_load_file('File.xml'); foreach ($preowned as $preownedinfo): $ADID=$preownedinfo->ADID; $CompanyID=$preownedinfo->CompanyID; $Category=$preownedinfo->Category; $StockNumber=$preownedinfo->StockNumber; $Year=$preownedinfo->Yrs; $Make=$preownedinfo->Make; $Model=$preownedinfo->Model; $Trim=$preownedinfo->Trim; $Odometer=$preownedinfo->Odometer; $ExteriorColor=$preownedinfo->ExteriorColor; $InteriorColor=$preownedinfo->InteriorColor; $Engine=$preownedinfo->Engine; $Transmission=$preownedinfo->Transmission; $Price=$preownedinfo->Price; $Options=$preownedinfo->Options; $AdDescription=$preownedinfo->AdDescription; $MainPhoto=$preownedinfo->MainPhoto; $AdditionalPhoto=$preownedinfo->AdditionalPhoto; $Doors=$preownedinfo->ExtraField->Doors; // echo '<pre>'.print_r($preownedinfo->ADID,true).'</pre>'; // echo '<pre>'.print_r($preownedinfo->ExtraField,true).'</pre>'; //echo '<pre>'.print_r($preownedinfo->ExtraField->ContentEN, true).'</pre>'; endforeach; } else { exit('Failed to open File.xml.'); }
  7. Cool! Now you know what simple an empty space causes in the script! Read these! 1. Debugging: A Beginner's guide 2. How To Ask Questions The Smart Way 3. Php security tutorial
  8. I think this is apache conf issue. On my web server, binary files as (jpg's, png's, pdf's) do not required to have ext in the end.
  9. Yep...because we have to have an empty space after the variable! Can you try this for me, please! $the_file = 'uploads/108'; // dump this result to be sure that everything is fine echo '<img src='.$the_file. ' />'; exit;
  10. He-he....cool....good for you...there were too many outputs on the same html document But..I'm still surprise why this did not work. $the_file = 'uploads/108'; // dump this result to be sure that everything is fine echo '<img src='.$the_file. '/>'; exit; By the way, for multiple files uploading, I'm using this API -> http://www.plupload.com/ http://www.plupload.com/example_queuewidget.php
  11. Too much errors! Try to create this app from beginning and debug every variables and outputs carefully. Sorry, I'm out.
  12. Put ini_set("display_errors", "1"); on the top of the file and delete that line - echo '<img src='.$the_file. '/>'; exit;
  13. O my God it was my fault. Re-read my reply #17 and change this: echo '<img src="$the_file" />'; exit; to echo '<img src='.$the_file. '/>'; exit; I quoted a variable name. Sorry for that.
  14. Try to reach the file statically: $the_file = 'uploads/108'; // dump this result to be sure that everything is fine echo '<img src='.$the_file.' />'; exit;
  15. No, you are wrong and the problem is here: $the_file = 'uploads'.'/'.$row['upload_id']; // dump this result to be sure that everything is fine The $row['upload_id'] should have an integer type because is not quoted! That's the problem, I think. Ignore the answer, I've tested that's no the problem.
  16. I think, I've got the answer You are assigning the binary file to integer.
  17. Add next lines of code immediately after the $the_file variable. $the_file = 'uploads'.'/'.$row['upload_id']; // dump this result to be sure that everything is fine echo '<img src="$the_file" />'; exit; PS: Assuming this file is binary! If everything is fine, you will get an image on the page. Also, how did you get binary data string through var_dump(), I am surprise too There is totally wrong somewhere in your scripts but I'm not sure exactly where. Can you post the link to this tutorial?
  18. Um...it should be work. I don't see any reason why that happens. The gibberish output is normal because you're dumping the image before to set any headers to it. Can you show us all updated code for this moment.
  19. Few quetions, before to continue the battle 1. Where do you upload the images (binary files) to -> "/uploads/" or to -> "uploads/" directory? Do you know the difference between them? 2. How do you store the name of the file to your database column, with or without extension name (i.e - name.jpg or just "name") 3. Why do you want to reach the binary file with its ID, (i.e /uploads/file_id)? 4. This means, there is no a directory with this name ( made a typo yesterday night) if (!is_dir('/upload')) { echo "True"; } change to if (!is_dir('/uploads')) { echo "True"; }
  20. Create your fake URL in the format as you want to be, then apply a rule for it. Example: <a href="./productdetail/34231">Product Detail</a> .htaccess RewriteRule ^/?productdetail/([^/]+)/?$ productdetail.php?prodid=$1 [L]
  21. Add this and give me the result back: $the_file = '/uploads'.'/'.$row['file_name']; // dump this result to be sure that everything is fine echo $the_file; exit; Are you sure that you have an upload directory inside web root? The easiest way: if (!is_dir('/upload')) { echo "True"; } else { echo "False"; }
  22. He-he, I just forgot to add a dollar sign in my script here Change: RewriteRule ^ /myfolder [QSA,L,R=307] to RewriteRule ^$ /myfolder [QSA,L,R=307] I will
  23. Does somebody try to move uploaded temp file to two different directories on the server. Or...when this function moved the temp file, the file has been deleted by php forever. Never tested. Something like: $tmp_name = $_FILES["pictures"]["tmp_name"] move_uploaded_file($tmp_name, "$uploads_dir1/$name"); move_uploaded_file($tmp_name, "$uploads_dir2/$name");
  24. Then, we will have a big mess PS: Rename the old file with rename php function, then copy this new file to get a duplicate name to other directory.
  25. <?php $file = 'one.jpg'; $newfile = 'one_thumb.jpg'; if (!copy($file, $newfile)) { echo "failed to copy $file...\n"; } ?> What happens here?
×
×
  • 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.