-
Posts
24,566 -
Joined
-
Last visited
-
Days Won
822
Everything posted by Barand
-
My cheques's in the post.
-
... how much?
-
Yes, that confirms that MySQLi is installed and the functions should be available to you
-
Re-run phpinfo(); and see if the MySQLi section has appeared and check the Loaded Configuration File setting to make sure you edited the correct php.ini file
-
Unable to get requested data and write onto cart table from posting form
Barand replied to Joel254's topic in PHP Coding Help
to see the error message you need die('Error: ' . mysqli_error($link)); or die('Error: ' . $link->error); Turning php error reporting on would alert you to that error -
Thank you for clarifying those questions that I had about your data. It would have given me a greater insight into what you want to do and enabled me to give you a better answer on how best to allocate and link the questions to the teams. However, as it is, I now know no more than when you originally posted, So I will wish luck with this project and say goodbye.
-
How many questions are asked per category? Are the questions multiple choice? If so, how do you identify the correct one? How do you record which answers were given by a team? How do you decide if the answer is correct, or partially correct, and therefore how many points? What is the purpose of "Question Group"? How does a "Challenge" relate to your data? (your code selects one question for a challengeID). I would have expected a "challenge" to relate two teams (A and B) who would share the common set of questions
-
try if ($_POST['submitted']) { switch ($_POST['submitted']) { case "Send Booking & Pay Deposit": // worldpay stuff //FALLTHRU (no break) case "Send Booking": // email stuff break; } }
-
Out of curiosity, do your `ctryvisits15` table rows contain a DATE column for the date of the visit? if so, the week number and quarter columns are redundant. You can derive both those values direct from the date. mysql> SELECT WEEK('2015-06-11') as wkno; +------+ | wkno | +------+ | 23 | +------+ mysql> SELECT QUARTER('2015-06-11') as qtr; +------+ | qtr | +------+ | 2 | +------+
-
I don't know what the contents of your variables are but this is what will cause that message and show you what you should look for. A string can be treated as an array of characters, so $username = 'fred'; // you can reference the individual charcters echo $username[0]; //--> f echo $username[3]; //--> d // but if the index used is non-numeric echo $username['']; //--> illegal string offset
-
Umm.. isn't that the other way round? You would need to turn EMULATE_PREPARES off for truly prepared statements.
-
this topic is also at http://forums.phpfreaks.com/topic/296729-creating-a-link-and-passing-data-to-open-another-report/?do=findComment&comment=1513616. Are you talking about a defined constant? eg define("DR", '12345") If that is the case you either assign the value to a variable ($dr = DR) and use that same syntax or use concatenation with the constant echo "<td style='text-align:center'><a href='kk_schedule_subreport.php?sn=$uompScheduleNumber&itm=".DR."'>$PRT_FR</a></td>";
-
Here's how you should be doing it, storing the competency ids in a separate table, one per row. +----------------+ +-----------------+ | user | | competency | +----------------+ +-----------------+ | user_id PK |--+ +---| comp_id PK | | username | | | | comp_name | +----------------+ | | +-----------------+ | | | +-----------------+ | | | user_competency | | | +-----------------+ | +---<| user_id PK | | | comp_id PK |>-+ +-----------------+ Then, to list the competencies for a user ($user) SELECT c.compname FROM user_competency uc INNER JOIN competency c USING (comp_id) WHERE uc.user_id = $user
-
You should be storing each id in a separate record, not in a single record as a comma-separated string, and probably with the id of the user who selected them.
-
try $clicks = '.testimonial;1119;316;1663;608;#header;723;66;1663;608'; $keys = array('postIdentifier', 'postPos_x', 'postPos_y','postWindowWidth','postWindowHeight'); $arr = explode(';', $clicks); $data = array_chunk($arr, 5); foreach ($data as $rec) { $sql = "INSERT INTO data (user_id, " . join(', ', $keys) . "', status) VALUES "; $sql .= "(1, '" . join("', '", $rec) . "', 'ok')";; echo $sql . '<br>'; } (Note I echoed the queries instead of executing)
-
Creating a link and passing data to open another report
Barand replied to kat35601's topic in PHP Coding Help
You are passing the values via the query string in the URL, therefore you need to $_GET instead of $_POST -
Creating a link and passing data to open another report
Barand replied to kat35601's topic in PHP Coding Help
href='subreport2.php?sn=$uompScheduleNumber&dr=$DR' -
what is "Fatal error: Unsupported operand types in" mean?
Barand replied to sigmahokies's topic in PHP Coding Help
A while() loop executes as long as the condition evaluates to true. Since you have 2 columns then $row is not equal to $display and so the loop does not execute. If you change to 1 column then the loop will execute infinitely, as neither of the values change in the execution of the loop. Either way it does not work. Shouldn't you be looping through the members sent in $_GET['members'] and listing those?- 9 replies
-
- vertical data
- php
-
(and 3 more)
Tagged with:
-
ob_flush(), contrary to the manual, appears to return true (1) ob_start(); echo ""; $body = ob_flush(); var_dump($body); //--> bool(true)
-
Help with limiting mysql to unique JOIN row print on php page
Barand replied to igorek24's topic in MySQL Help
That is the nature of joins. Data from the vehicle is joined to each matching service record's data. As you want to show the service date, how would you expect a single record if there are multiple services? -
It took you until reply #30 to show an accurate version of the POST contents with var_dump($_POST). When you finally did, you chose to show it without any data which was as much use as a chocolate teapot. Now you claim it looks like so it looks like an extra element has crept in from somewhere. You also say that you want to update the database. No statement of exactly what that update should do. Do you think we can can read your mind? Sorry but getting the information required to help you is like getting blood out of a stone and life is too short.
-
what is "Fatal error: Unsupported operand types in" mean?
Barand replied to sigmahokies's topic in PHP Coding Help
It will never fly! Suppose 6 members selected $display = ceil(count($_GET['member'])); // $display -> 6 (ceil not required) $row = ($display/$columns); // $row -> 3 (this is where you want ceil) while ($row = $display) { // $row never == $display so doesn't execute $data['Name'] = $row; // assigning number to $data['Name'] ??? }- 9 replies
-
- vertical data
- php
-
(and 3 more)
Tagged with:
-
Creating a link and passing data to open another report
Barand replied to kat35601's topic in PHP Coding Help
Can't you just make those 2 items links. EG echo "<td style='text-align:center'><a href='subreport1.php?sn=$uompScheduleNumber'>$PRT_FR</a></td>"; echo "<td style='text-align:center'><a href='subreport2.php?sn=$uompScheduleNumber'>$DR</a></td>"; -
Is this of use http://www.phpclasses.org/blog/post/287-PHP-Integration-with-Embedded-Hardware-Device-Sensors.html