Jump to content

gw1500se

Members
  • Posts

    1,029
  • Joined

  • Last visited

  • Days Won

    16

Everything posted by gw1500se

  1. 1. please use the code icon (<>) and specify PHP. It makes your code much easier to read. 2. learn to indent your code. 3. what is up with ?> and <?php and no intervening HTML? It makes it very difficult to see where your code blocks end. Your code should look more like this: for($i=0;$i<6;$i++) { $title = ($_POST['hidden_name'.$i]); $price = ($_POST['hidden_price' . $i]); $quantity = ($_POST['quantity' . $i]); if($quantity>0){ $shortStr= substr($price,1,-1); $flatVal=(float)$shortStr; $flatVal=$flatVal*$quantity; $totalItem=$flatVal*$quantity; $total+=$flatVal; } } I didn't include everything in the loop and if blocks as it is too difficult to follow but you should get the idea.
  2. The warning has nothing to do with your IDE. The problem is the version of PHP and version of mysqlnd. Run the following code to get the version of PHP and the version of mysqlnd. <?php phpinfo(); ?> You probably need to update one or the other. You also do not say which is line 15 and you are not use the code icon which makes your code easier to read.
  3. Don't make people go to a 3rd party web site. Post your code here using the code icon (<>) and specify PHP.
  4. 1. When posting PHP code use the code icon (<>) and specify PHP. Similarly do the same for HTML. 2. Never, ever use web data directly in queries. Use prepared statements to prevent injection attacks. 3. Don't use * in SELECT statements. List only those columns that you actually are going to use. 4. During development turn on all error reporting. error_reporting(E_ALL); Did you echo $_POST['search'] to make sure it contains what you expect? Did you check they httpd log to see if there are any errors there?
  5. Adapt the standard compound interest formula: A=P(1+r/n)^(nt) Where: A= amount P=principle r= interest rate n= number of compoundings per year t= number of time periods For continuous compounding use: A=Pe^(rt) Where: t=time in years (can be a fraction) e= mathematical constant (2.71828)
  6. I don't know where that directory is, you do. I only know the path you had originally did not make sense so I made a suggestion. You have to provide the correct path.
  7. The message is clear. The path is wrong. You probably want: $directory = "C:\Users\%username%\Desktop\Rajesh song";
  8. Using '.name' is definitely wrong as it looks like 'name' is the column you want. I suspect that is because of a misplaced quote which are unnecessary anyway. You also should not be using 'SELECT *'. List only those those columns you actually need. Your first query is dangerous. You need to use prepared statements. Never use web page data directly into a query as you are at risk of injection attacks. Finally the ';' is not really needed but that is a minor point. $result = $mysqli->query("SELECT studentid,name,pacomment FROM data WHERE classroom = $classroom ORDER BY name") or die($mysqli->error);
  9. You don't need the 'while'. Do the 'fetchall' once then run your 'for' loop. Anyway, I agree with Barand, PDO is a better choice.
  10. Add: AND name='Stone Cold' to your WHERE clause in the query. Assuming 'name' is that column name.
  11. I think fetch returns false only on failure. A query can be successful but return no rows. You might want to check to that condition.
  12. I don't see where that variable is set anywhere.
  13. There has to be more to Loader.php than that. What you posted won't even compile.
  14. You need to post Loader.php and point out which line is 346.
  15. This is a PHP programming forum. You post the code causing the error message and we can help figure out what is wrong with the code. Is the error caused by your code or by the web site upload process? If your code, post it. Be sure to use the code icon (<>) and specify PHP.
  16. Have you tried InfinityFree support? This does not look like a PHP programming problem to me.
  17. For Linux use the LPR printer class.
  18. You are not saving then using the statement object returned by prepare. RTFM
  19. Only true if the column of the where clause does not exist. Unless, of course, you don't have privileges. This should get you started.
  20. When I said leave the action off I meant that literally. Don't put that in at all but I don't think that is the real problem. Start debugging by putting print statements after each mysqli to follow your logic so you can tell where it is failing. If you are getting a blank page then make sure there is no logic path where there is no output. Also check the page source to see if there is anything there that the browser is not displaying.
×
×
  • 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.