-
Posts
24,566 -
Joined
-
Last visited
-
Days Won
822
Everything posted by Barand
-
Passing from data to PHP to capture variables and run an exe
Barand replied to lynns's topic in PHP Coding Help
Your exec() parameters use $Email and $CompanyName but you put the values into $user and $company -
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.
-
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`?
-
As you process the results, accumulate the total. Check for a change of id and output the total on change.
-
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.
-
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']
-
Fatal error: Call to a member function fetchALL()
Barand replied to omardavinci's topic in PHP Coding Help
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. -
page php, how include input and type to search in my table
Barand replied to omardavinci's topic in PHP Coding Help
It's the manual that you should be checking http://uk1.php.net/manual/en/mysqli.select-db.php -
page php, how include input and type to search in my table
Barand replied to omardavinci's topic in PHP Coding Help
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); } -
Alternative to "Include" inside while loop
Barand replied to learningprobs's topic in PHP Coding Help
@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) -
Confirm Form Resubmission when refreshing browser
Barand replied to davinci29's topic in PHP Coding Help
Interesting. -
I do not see anything in your attached image that could not be produced simply with FPDF.
-
try SELECT parent.name as parent , GROUP_CONCAT(child.name) as children FROM parent JOIN child USING (familyID) GROUP BY parent.familyID;
-
Do the A and B weeks alternate? If they do then just setting whether the first is A or B should suffice.
-
or you could look up the syntax in the manual http://dev.mysql.com/doc/refman/5.6/en/fulltext-search.html#function_match
-
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 | +------------+--------------------------------------------------------------------------+
-
I'm stuck with access.mdb need help with this code
Barand replied to dlbDennis's topic in PHP Coding Help
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. -
I'm stuck with access.mdb need help with this code
Barand replied to dlbDennis's topic in PHP Coding Help
You have been told what's wrong. -
No - I think your problem was probably the "." in schedule.date. But checking error messages would confirm.
-
BTW, have you checked for any error messages yet?
-
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.
-
on t4.schedule.date > '$today' WHERE t1.schedule.date < '$week' "; ^ ^ | |
-
Probably because of query errors. Check what $conn->error contains. Are you sure about the last join and the where condition?