Jump to content

jazzman1

Staff Alumni
  • Posts

    2,713
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by jazzman1

  1. Keep in mind, that MySQL is not designed to be a hierarchical database, it's a relational database. When you're going so deeply in the hierarchically tree structure, your code will get much harder to read from you or somebody else after at time. Remember, we are human not machines and our effort should be pointed out to anyone, who can understand what's going on in the script as better as possible. I would suggest you, to take down the fetching data from MySQL and to do this in php.
  2. I'm not sure that a glob() supports the Hypertext Transfer Protocol (HTTP). Example2, if the searchable images are outside of the current directory: $dir = $_SERVER['DOCUMENT_ROOT'].'/'.'path_to_image_directory'; foreach (glob($dir.'/'.'*.*') as $filename) { echo "<a href=\"".$filename."\">".$filename."</a><br/>"; }
  3. You only send these statements to your SQLite database. Then, you need to fetch the results from the DB server storing them to those two variables. $userEmail = $db->query("SELECT email FROM users WHERE email='$email'"); $userPsswd = $db->query("SELECT password FROM users WHERE email='$email'");
  4. How the users know if they successfully logged or failed? Is there some message coming from the server to them?
  5. Try, <?php $dir = __DIR__; foreach (glob($dir.'/'.'*.*') as $filename) { echo $filename; }
  6. I'm not using cURL in php, but try to set if (curl_errno($returndata))
  7. That's wrong! You cannot use a copy function before the image has been successfully uploaded on the fileserver. Instead a copy function use the move_uploaded_file() !
  8. Put these two lines of code on the top of this file which code you posted above: error_reporting(E_ALL); ini_set("display_errors", 1);
  9. Turn on the error_reporting functions on the top of this page, which help you/us what could be causing this problem!
  10. Well, then don't use <textarea></textarea>, use <input type="file">, upload the file into the fileserver, explode the content of this file, delete it and store the content to DB, if this is your personal issue!
  11. What browser are you using for the test? I'm not sure whether you can increase this limit in AJAX. What "Google" says?
  12. I think, AJAX limits you not jQuery, but to be sure 100% make the same request by core javascript. A textarea supports a maxlength attribute in HTML5.
  13. Good morning gardener I'm afraid I'm not the right person in CSS. Just create a new topic thread in the HTML/CSS section, it's free of charge Take a look at here and here.
  14. Hm....I'm not sure what could be causing this problem. Did you try to upload the data without javascript (just for test)?
  15. You are not able to upload this large date, then to store it to your DB. Make sure, there is no an apache rule for a size limits inside .htaccess Also, give us some info of those: (check inside a php.ini file)
  16. Then, you should have to consider to change the current type of this column to MEDIUMTEXT or LONGTEXT. http://dev.mysql.com/doc/refman/5.0/en/blob.html
  17. You cannot upload this data to the fileserver or you cannot store it to the database?
  18. Hm.....more than 3000 letters through GET
  19. Try to set a php engine to off inside this particular directory. Never tested: http://www.electrictoolbox.com/disable-php-apache-htaccess/
  20. You are surprising me every time What that question is
  21. off: Your background is huge and very heavy to people like me who prefer to browse on the web without any cache. You have to consider using some CSS techniques.
  22. Why? This is very good practice. If you want to upload some data no needs to use a hidden field inside the form, but when you try to update the same data, it's always good to have a hidden filed with this id. EDIT: The part that I don't understand is how (where) you instantiated these objects?
  23. Where $this->img_name comes from? $st->bindValue( ":img_name", $this->img_name, PDO::PARAM_STR ); $st->bindValue( ":imageFile", $this->img_blob, PDO::PARAM_LOB);
  24. Your script works fine, I tested. <?php // Prepare image $imageFile = file_get_contents($_FILES['file']['tmp_name']); // Insert link $conn = new PDO( 'mysql:host=localhost;dbname=DUMB_DB', 'jazzman', 'password' ); $sql = "INSERT INTO images (img_blob) VALUES (:imageFile)"; $st = $conn->prepare ( $sql ); $st->bindValue( ":imageFile", $imageFile, PDO::PARAM_LOB); $st->execute(); Result: SELECT LENGTH( img_blob) FROM DUMB_DB.images WHERE id=1; // 770042 bits So, I would suggest to change the type from BLOB to LongBlob.
  25. I'm not entirely agree about performance which was mentioned above. It really depends! @tomce, did you execute() the sql statement at the end?
×
×
  • 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.