boompa
Members-
Posts
305 -
Joined
-
Last visited
-
Days Won
1
Everything posted by boompa
-
if (isset($_POST['Zoeken'])) { // code }
-
Then you need to look into JavaScript and AJAX.
-
You probably need to look into using SQL JOINs on the data in the DB.
-
Or it's from Yii: http://www.yiiframework.com/doc/api/1.1/CDbCommand It is looking for a table named "t" in the database mccombpo_data, but there is no table (or view) by that name in the database. If there is supposed to be a table with the name "t", then you have either a configuration problem or a database schema problem. If you're not supposed to have a table named "t", I'm guessing a query is messed up somewhere, like you wanted to do this: SELECT t.id FROM toys t WHERE t.manufacturer='Hasbro' but you forgot the table name in the alias attempt: SELECT t.id FROM t WHERE t.manufacturer='Hasbro' If this is framework code, that makes it a little more difficult to figure out. You might need to turn up logging to get more information as to where it's happening so as to determine why it is.
-
Looks like it could be CakePHP. If so, would put this: $options = ListingFieldProperties::getCountriesOptions(); in the controller: $this->set('countries', ListingFieldProperties::getCountriesOptions()); and set the default in the controller as well: $defaultCountry = /* whatever the ID of USA is */; So you end up with this in the view: echo $form->input(ListingFieldProperties::COUNTRY_FIELD,array("type"=>"select","options"=>$countries,"label"=>"","default"=>$defaultCountry));
-
Which line is it ? (In MySQL error message number 1064)
boompa replied to roparzhhemon237's topic in PHP Coding Help
$request_string='UPDATE forum_read SET fw_alert = :alt '. 'WHERE fw_topic_id = :topic AND fw_user_id= :user)'; Why is there a ) at the end of that query? -
Problems accessing nodes after using simplexml_load_file
boompa replied to kellendil's topic in PHP Coding Help
One way to do this, although I must admit I don't understand why people seem to insist on parsing SOAP responses rather than using SoapClient: $xml = simplexml_load_file('soap.xml'); $xml->registerXPathNamespace('SOAP-ENV', "http://www.w3.org/2003/05/soap-envelope"); $body = $xml->xpath('SOAP-ENV:Body')[0]; echo $body->Order->OrderHeader->OrderNumber->BuyerOrderNumber; -
You could just use in_array here. <?php $id1 = '5'; $id = array(1,2,3,4,5,6,7); if (in_array($id1, $id)) { // Found match } else { // No match }
-
<?php $data = array ( 'firstname' => 'JOHN', 'lastname' => 'SMIth', 'address' => '2 EFFIN ClOse' ); function properCase($val) { // Convert to lower, then proper-case it. return ucwords(strtolower($val)); } // Apply the above function to each value in the array. $tada = array_map('properCase', $data); // Print the array. foreach($tada as $key => $value) { print "$key => $value\n"; } Results in: firstname => John lastname => Smith address => 2 Effin Close
-
help urgently needed resolving php cron file errors
boompa replied to JewelsPiper's topic in PHP Coding Help
What is the line in your crontab for running this script? -
You should really consider using a dedicated mailer class, like PHPmailer or SwiftMailer.
-
Looks suspicious to me. See this thread: http://forums.phpfreaks.com/topic/287489-please-help-removing-first-line-of-php/
-
invput is apparently the name of the script/program. It could be written in any language at all, or the web server could be rewriting the url to /invput.php or something else. In the end, it does not matter to you; it's a script/program available through the web server which accepts a set of name-value pairs as a GET request and responds to you.
-
Use json_decode.
-
You need to read the manual on for loops, paying particular attention to the middle argument.
-
Did you know there are MySQL functions for both of those? You may just be able to use those. https://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html
-
You do realize the security implications of allowing direct user input in a Linux command line, right?
-
It looks to me like this issue is the PLHIM menu plugin. It contains a variable called STREAM which has links to html versions of your files. Where this is a third-party script, I'm not sure how they go there as it looks auto-generated.
-
http://forum.wampserver.com/read.php?2,45057,45079
-
<?php $xmlString = file_get_contents('http://www.inveroak.co.uk/readerimages/livepanel/91255.xml'); $xml = simplexml_load_string($xmlString); // load_string, not load_file $readers = $xml->xpath("/ReaderDetails/Reader[Pin='4087']"); var_dump($readers);
-
Again, the documentation for sqlsrv_num_rows says And, if you look on the sqlsrv_num_rows page, there's even...an example.
-
Here's the documentation for sqlsrv_num_rows: http://www.php.net/manual/en/function.sqlsrv-num-rows.php Your call to this function is returning FALSE. Reading the linked page above, we see the following in the Return Values section: Please take note of the second sentence. You need to change how you call sqlsrv_query, specifically the options you are sending. Here is the manual for that function: http://www.php.net/manual/en/function.sqlsrv-query.php
-
Maybe avoid trying to stick everything on one line and write a function? <?php function get_review_link($user_data, $product) { if ($user_data['group_id'] == GROUPS_ADMIN) { return '<form method="post" action="' . get_url('/products/', $product['category_id'], $product['product_id'], $product['product_name']) . '?action=review">'; } return ''; } echo get_review_link($user_data, $product); ?>
-
How about getting the number of days until the end of the year instead of looking at months? Then do some arithmetic.
-
This is not a PHP issue (because PHP runs on the server, it makes no sense unless you wanted to print to something directly connected to the server). This is the element in your page's source code: <a class="printBtn">Print the Bliss List</a> There is no href attribute, so it's not going to show as anything but text, and it's not going to do anything when it's clicked. I'm guessing that there is supposed to be some JavaScript on your page that turns elements with the printBtn class into an actual button, and initiates the print process on clicking it. In fact, it probably combines with the "printable" class to which the div containing the important content belongs: <div class="printable">