Jump to content

mikosiko

Members
  • Posts

    1,327
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by mikosiko

  1. Finally!!... good to have it back
  2. Read carefully what you wrote (in red) and compare it with what you are doing in your select... you should be able to figure it out
  3. In that code you have 2 issues: 1.- You can not mix mysql_ and mysqli_ APIs 2.- mysqli_query() (and in general all the "mysqli_" procedural methods/functions) need to have the database link as a parameter.... read http://php.net/manual/en/mysqli.query.php here are some usage's examples http://php.net/manual/en/mysqli-result.fetch-array.php
  4. food for the thought: (meaning for you to read and investigate the causes of the error and do not create a worst bandaid) http://dev.mysql.com/doc/refman/5.6/en/gone-away.html http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_wait_timeout http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_max_allowed_packet and a question: What type/size are your columns called SName (in both tables)?
  5. In case you are willing to explore the alternative Mysql also provide the FEDERATE storage engine to solve your scenario https://dev.mysql.com/doc/refman/5.5/en/federated-storage-engine.html
  6. In your code you are using the variable $conn as your database connection for both your SELECT and for the INSERT. as mac_gyver mentioned before you should be using 2 different variable names for your database connections and use them in the right place
  7. If you go directly to that directory look for the laravel.bat or similar an try to execute it there... The error message is clear enough... Did you try restarting your computer and try?
  8. And you did this? "Make sure to place the ~/.composer/vendor/bin directory in your PATH so the laravel executable is found when you run the laravel command in your terminal."
  9. Are you using this code just as a learning exercise and for one time execution? (hope so) or are you planning using it to create a database and associated table(s) for Each project? If the lastest is the case then IMHO you are using an incorrect approach, you should have only one database and define your tables to manage multiples projects/rfis
  10. you are generating a <tbody>...</tbody> tags inside of your foreach loop... take those out of the loop and test
  11. Are you sure that you are including the bootstrap CSS in your code, are you?
  12. Obvious queations: - are you sure that your sql query is executing correctly - it is producing any results? - what is the contain of $data after the loop? - what is the contain after json_encode? And last but not least - where are you defining $outp?
  13. After modifying the php.ini did you restarted the Web server? (Apache or whatever) You don't notice anything missing in this line? $my_db = "notes_db" And in this one.. Is that exactly what you wrote using string literals or your were trying to use the previously defined variables? (like $my_host or $my_user, etc.) $con = mysqli_connect("localhost","my_user","my_password","my_db");
  14. Do you have a table named post and other named posts ?
  15. Read the error message that you are getting very...very..very carefully again... Reason is there in plain sight
  16. In addition to what boompa pointed out your whole code logic doesn't make to much sense... You need to rethink it. Your sales-authorisation table is going to have only one record or many? Is there any relation between the sales-authorisation and the order, each order item or it is applied globally? Do you realize that you could be updating your order over and over in the inner loop?, and for each order item?..
  17. Did you check if your $sql contain a valid INSERT sentence? And in your query() function... What are you trying to do in this line If ($this->_query = $this->_pdo->prepare($sql)) a comparison or an assignment?
  18. you mean HAVING COUNT(s.shoe_id) = 2 right?.... sure was a typo
  19. could you post a REAL example of the content of modsToBeChecked ? An Internal Server error normally is logged... are you sure that you are looking the right logs files? The last code that you posted works fine on testing, therefore seems that the POSTED code is not the issue here. Are you psoting the WHOLE code that you are using?...
  20. Sure that you don't see anything wrong in your INSERT sentence?.... You are enclosing all the field names using single quotes which make the sentence invalid ... you would have noticed that with the proper error_reporting and display_error setup either in your php.ini (prefered) or directly in your code adding this 2 lines after your opening <?php tag: // Define how to display/report errors ini_set("display_errors", "1"); error_reporting(-1); maybe you tried to enclose your fieldname on backticks (`) but that is absolutely unneccesary if you are not using reservated mysql words or other special identifiers. An additional note: Using the values of your $_POST variables directly in your query make your code fully open to SQL Injections, you should be using Prepared sentences and be sure that PDO is using real ones and not emulating preparated sentences which leave you in the same spot that your code is now.... for real Prepared sentences be sure to include PDO::ATTR_EMULATE_PREPARES => false in the options of your PDO definition.
  21. @Texan78 .... Try testing that code with $magnitude = 0 and see what do you get Edit: Psycho gave you the reasoning behind
  22. There's a way to avoid this loop? Yes and No..Well, it is way to eliminate the extra prepare/execute/query inside the loop.. use a JOIN between the 2 tables, get the resultset of that JOIN and traverse (with a loop) it to produce your JSON in the format that you want/need
  23. NO... your code have changed several times before your first and subsequent posts... we are not seeing your screen, and we can't assume that you are getting the same errors or new ones... so either your provide ALL the current errors or people around here will not have means to "see" what is happening, and will still just guessing. read my post again and review what is there for you. good luck
×
×
  • 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.