Jump to content

Barand

Moderators
  • Posts

    24,345
  • Joined

  • Last visited

  • Days Won

    795

Everything posted by Barand

  1. Possibly a permissions problem? I think that, when running from IIS, the user is "IUSR_computername".
  2. You have a a single quote after OUTFILE which does not appear to have a corresponding closing quote
  3. Your exec() parameters use $Email and $CompanyName but you put the values into $user and $company
  4. There is no prepare statement in your code. Sorry, but if you you can't understand that what I said in my last post could pose a problem, then you are beyond any help I could offer.
  5. In an earlier post on this forum (http://forums.phpfreaks.com/topic/302132-page-php-how-include-input-and-type-to-search-in-my-table/?do=findComment&comment=15372780) you had So why are you using the `coffee` table with a form for entering firstname, lastname and age? Or are all your tables named `coffee`?
  6. As you process the results, accumulate the total. Check for a change of id and output the total on change.
  7. You would use "Europe/London" The best place to set the default timezone is in your php.ini file. That will save you from having to change every program.
  8. Do the calculation in the query SELECT receptie.id , receptie.marca_tel , receptie.model , receptie.data_primire , articole_service.pret_sol , articole_service.pret_achizitie , articole_service.pret_sol - articole_service.pret_achizitie as profit -- add this FROM receptie inner join articole_service on receptie.id = articole_service.id_receptie then output $row['profit']
  9. You need to familiarize your self with concepts of string variable code You cannot just put code in the middle of a string variable like that, it will just become part of the string. "View source" of your output page to see.
  10. It's the manual that you should be checking http://uk1.php.net/manual/en/mysqli.select-db.php
  11. The slowest part of your function is the database connection. Do not connect every time you call the function - coonect once only at the top of your script then pass the connection variable as a parameter to your functions. You also fetch each row as an array of columns, move them from the array to individual variables then create an object from those variables which you then add to an array. Sounds like a lot of work. Why not pass the row to create your coffee object? while ($row = mysqli_fetch_array($conn, $result)) { // if you use mysqli $coffeeArray[] = new CoffeeEntity($row); }
  12. Set $select='' before the while loop. You are attempting to append to a non-existant string.
  13. @maxxd, That is not a problem. Consider this mysql> SELECT firstname -> , lastname -> , gender -> FROM employees -> ORDER BY lastname; +-----------+----------+--------+ | firstname | lastname | gender | +-----------+----------+--------+ | Emily | Bronte | F | | Jane | Doe | F | | Jack | Evans | M | | Patricia | Jones | F | | Davy | Jones | M | | John | Smith | M | +-----------+----------+--------+ Suppose that, for some weird reason, we wanted all those whose first name began with 'J' to be listed first. mysql> SELECT firstname -> , lastname -> , gender -> FROM employees -> ORDER BY SUBSTRING(firstname,1,1)='J' DESC, lastname; +-----------+----------+--------+ | firstname | lastname | gender | +-----------+----------+--------+ | Jane | Doe | F | | Jack | Evans | M | | John | Smith | M | | Emily | Bronte | F | | Patricia | Jones | F | | Davy | Jones | M | +-----------+----------+--------+ The comparison in the ORDER BY clause evaluates to true(1) or false(0)
  14. I do not see anything in your attached image that could not be produced simply with FPDF.
  15. All true. In history I learnt that King Alfred burnt the cakes, but no use crying over over spilt milk. But I'm from the other side of the pond.
  16. try SELECT parent.name as parent , GROUP_CONCAT(child.name) as children FROM parent JOIN child USING (familyID) GROUP BY parent.familyID;
  17. Do the A and B weeks alternate? If they do then just setting whether the first is A or B should suffice.
  18. or you could look up the syntax in the manual http://dev.mysql.com/doc/refman/5.6/en/fulltext-search.html#function_match
  19. SELECT * FROM mytable; +------------+--------------------------------------------------------------------------+ | mytable_id | link | +------------+--------------------------------------------------------------------------+ | 1 | [url]https://www.youtube.com/watch?v=ABC123[/url] | | 2 | [url]http://www.google.com/watch?q=SQL REPLACE[/url] | | 3 | [url]http://dev.mysql.com/doc/refman/5.6/en/functions.html[/url] | | 4 | [url]https://www.youtube.com/watch?v=XYZ789[/url] | +------------+--------------------------------------------------------------------------+ UPDATE mytable SET link = REPLACE(REPLACE(link, '[/url]', ''), '[url]', '') WHERE INSTR(link, 'www.youtube.com'); SELECT * FROM mytable; +------------+--------------------------------------------------------------------------+ | mytable_id | link | +------------+--------------------------------------------------------------------------+ | 1 | https://www.youtube.com/watch?v=ABC123 | | 2 | [url]http://www.google.com/watch?q=SQL REPLACE[/url] | | 3 | [url]http://dev.mysql.com/doc/refman/5.6/en/functions.html[/url] | | 4 | https://www.youtube.com/watch?v=XYZ789 | +------------+--------------------------------------------------------------------------+
  20. Even though you can see the information that you want in the contents of that var_dump() after the first odbc_fetch_array($result) ? I'll - type- slowly - for - you - You - have - the - results - after - that - first - fetch. - After - that - there- are - no - more - records - left - to - fetch - so - the - results - of - the - next - fetch - are - empty.
  21. Barand

    Join

    No - I think your problem was probably the "." in schedule.date. But checking error messages would confirm.
  22. Barand

    Join

    BTW, have you checked for any error messages yet?
  23. Barand

    Join

    Why the join to schedule t4? Why not just WHERE t1.schedule_date > '$today' AND t1.schedule_date < '$week' And you should be using a prepared statement instead of dropping values into the query.
×
×
  • 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.