-
Posts
24,605 -
Joined
-
Last visited
-
Days Won
830
Everything posted by Barand
-
perhaps +-------------+ | chart | +-------------+ +-------------+ | +---------------+ | series | | | category | +-------------+ | +---------------+ | | | | /|\ | | +-------------+ | +-------------<| value |>--------------+ +-------------+
-
So if your categories are the continents then you could have a chart showing population growth, say, but you could not then have another chart for those continents showing economic growth.
-
According to that model, a chart can have many categories but a category can belong to only one chart.
-
Check database name before running a query in phpMyAdmin
Barand replied to cyberRobot's topic in MySQL Help
The idea is to "USE databasename" to set the correct database name as default -
Check database name before running a query in phpMyAdmin
Barand replied to cyberRobot's topic in MySQL Help
I can think of only three ways Only ever have a single database on your server Execute the statement "USE databasename" before every query. In INSERT, UPDATE and DELETE queries always prefix the table names with dbname (ie dbname.tablename). No damage is done with SELECT queries I suppose a fourth way is be careful what you are doing -
How to eliminate double values in dynamic dropdown on update?
Barand replied to learningprobs's topic in PHP Coding Help
Use "SELECT DISTINCT ... " You seem to have design flaws in the database. If the table contains the id and name then they should be unique. If, on the other hand, it's a table at the "many" end of a one-to-many relationship then the name shouldn't be in the table, just the id. -
see https://en.wikipedia.org/wiki/Phrases_from_The_Hitchhiker%27s_Guide_to_the_Galaxy#Answer_to_the_Ultimate_Question_of_Life.2C_the_Universe.2C_and_Everything_.2842.29
-
back to PDO and get strange error on online host not on wamp
Barand replied to lovephp's topic in PHP Coding Help
You might want to consider altering the logic of the program so that if there are no results to display then you do not even attempt to paginate nothing. -
Something I've already told them in another post (http://forums.phpfreaks.com/topic/301723-error-saving-data-in-mysql-table/). Why do we bother?
-
HTML colours have three colour components, namely red, green and blue. Each of these has a value ranging from 0 to 255. These are expressed as hexadecimal values 00 to FF. #FF0000 = red #00FF00 = green #0000FF = blue equal quantities of each component gives a grey color, for example #888888 gives a mid-grey. In the function, the variables $r, $g and $b are the red, green and blue values. Those look fairly meaningful to me, better than $peter, $paul and $mary.
-
Help to get Json data to a comma delimited file
Barand replied to techboy992's topic in PHP Coding Help
Having got the data into a CSV file you can load it into a MySql table using LOAD DATA INFILE statement -
Help to get Json data to a comma delimited file
Barand replied to techboy992's topic in PHP Coding Help
Not throwing an error does not mean it works. It removes the characters from the text fields also It still leaves commas in the currency field -
Creating multidimensional arrays from SQL table
Barand replied to NotionCommotion's topic in PHP Coding Help
@requinix - It was tricky getting the timing just right -
Creating multidimensional arrays from SQL table
Barand replied to NotionCommotion's topic in PHP Coding Help
try $sql = "SELECT co.id , co.name , car.id , car.model FROM companytest co INNER JOIN cartest car ON co.id = car.make ORDER BY co.id, car.id"; $res = $db->query($sql); $cars = []; $prev = ''; while (list($coid, $coname, $cid, $model) = $res->fetch_row()) { if (!isset($cars[$coid])) { $cars[$coid] = ['id' => $coid, 'name' => $coname, 'cars' =>[] ]; } $cars[$coid]['cars'][] = ['id' => $cid, 'model' => $model]; } the data mysql> select * from companytest; +------+----------------+ | id | name | +------+----------------+ | 1 | Ford | | 3 | General Motors | | 5 | Chrysler | +------+----------------+ 3 rows in set (0.00 sec) mysql> select * from cartest; +------+------+------------+ | id | make | model | +------+------+------------+ | 1 | 1 | Mustang | | 2 | 1 | Fusion | | 3 | 3 | Corvette | | 4 | 3 | Escalade | | 5 | 5 | Charger | | 6 | 5 | Challenger | +------+------+------------+ 6 rows in set (0.00 sec) -
Do you have error reporting turned on? Have you checked the values of mysqli_error? I cannot do it for you.
-
Similarly, the code you just posted, the input to simplexml_load_string() is $result->GetDailyListingSummaryResult->any That should be the XML.
-
First step to debugging is to have error_reporting switched on and also check for mysqli_error values after attempting queries. Where is $resultat defined? If it isn't it should be throwing an "undefined variable" error.
-
Your data shows team as character field, yet you create a table with team name as INT and goals as varchar(). As this table contains only one field for goals, and you say you want both a count and a total, which goes in the new table (count or total). And why are you doing this at all? You can get these by query any time, you should not store data derived from the data in databases.
-
That is NOT xml, it is a var dump output of some xml data that has been processed by simplexml.
-
Can you describe what is is you are trying to do so I can make some sense of your code.
-
Help to get Json data to a comma delimited file
Barand replied to techboy992's topic in PHP Coding Help
You might want to test that solution before you go any further -
Consider this scenario. You have the following statuses 1 - not started 2 - work in progress 3 - completed. So now, anything not completed has "status < 3" and all works well with your query. You boss now tells you they are introducing new status codes 4 - temporarily on hold. 5 - cancelled status < 3 no longer gives you all those that are not completed.
-
WTF ???
-
Make sure your bind_param() has the params in the same order as the placeholders in the query