-
Posts
1,469 -
Joined
-
Last visited
-
Days Won
12
Everything posted by CroNiX
-
The form controls need to be located within the form open (<form>) and close (</form>) tags. <form action = "test.php" method = "post"> <select name="Words"> <?php FOREACH($ddArray1 AS $word){ PRINT '<option value="'.$word.'">'.$word.'</option>'; } ?> </select> </form>
-
Execute PHP code before any files using .htaccess
CroNiX replied to Slyke's topic in PHP Coding Help
You can't do that. .htaccess is processed before anything else. -
Permission Denied in php file read when file owner is not apache
CroNiX replied to snehu's topic in Apache HTTP Server
Log in as the webuser, not root (or sudo). Or have PHP create the file which should automatically have the correct permissions. -
I've found laracasts to be very helpful. https://laracasts.com/
-
Calculate total, discount and tax amount through onkeyup function
CroNiX replied to mythri's topic in Javascript Help
You are making this difficult to help you. To me, entire page means starting with <html> and ending with </html>. The code above does not contain these elements that you are using in your jQuery, so once again it's incomplete code: $(".invE_subtotal span") $(".invE_tax span") $(".invE_discount span") $(".invE_balance span") -
Calculate total, discount and tax amount through onkeyup function
CroNiX replied to mythri's topic in Javascript Help
Again, we need the SOURCE of the full rendered page, not your php. Go to the page in the BROWSER and click view source, and copy/paste the whole thing here. -
Calculate total, discount and tax amount through onkeyup function
CroNiX replied to mythri's topic in Javascript Help
The WHOLE complete page. There aren't even any TR's in that. -
swopping description and date in mysql database
CroNiX replied to scuttzz's topic in PHP Coding Help
Also, since you are using bound query parameters (good!) in your query, you shouldn't do this: $_POST = array_map( 'stripslashes', $_POST ); -
swopping description and date in mysql database
CroNiX replied to scuttzz's topic in PHP Coding Help
It's being swapped because that's what you are telling it to do. INSERT INTO event_calendar (title,event_date,description) VALUES (:title, :description, :event_date)') Your insert is saying (in order), title, event_date, description but your VALUES (in order) are :title, :description, :event_date. Swap the :description and :event_date placeholders in the VALUE. -
It's hard to guess with just your description and no code to review, but are you using session_start() ??.
- 7 replies
-
- phpphp 5.2.17
- php 5.4.29
-
(and 1 more)
Tagged with:
-
Calculate total, discount and tax amount through onkeyup function
CroNiX replied to mythri's topic in Javascript Help
It might be easier if you showed the raw, html output (source) of this page. We don't have access to your database/data. If we had the raw output it would be a lot easier to troubleshoot the jQuery. -
Execute PHP code before any files using .htaccess
CroNiX replied to Slyke's topic in PHP Coding Help
You're not adding a query string. You're just adding a variable FROM the query string as the last segment. -
Barand has a better solution, but mine was something like: $count = 0; //keep track of where we are in the array $separate = 4; //number of entries before new ul echo '<ul>'; while($row = $results->fetch(PDO::FETCH_ASSOC)) { //If we hit $separate by checking modulus operator, close ul and start a new one if ($x%$separate == 0) { echo '</ul><ul>'; } //output li's echo '<li>Mileage: '.number_format($row["Mileage"]).'</li>'; echo '<li>Engine size: '.$row["EngineSize"].'cc</li>'; //increment counter $count++; } echo '</ul>';
-
Create a counter before the loop, and increment it by one just before the end of the loop and check the counter within the loop to process differently? Hard to say with the information provided.
-
Probably due to name recognition from years of watching their TV ads.
-
.htaccess write php string query in url
CroNiX replied to Richard_Grant's topic in Apache HTTP Server
Probably because you have a trailing slash in the RewriteCondition -
Slow Query Running/Page Rendering While MySQL Event Is Being Executed
CroNiX replied to phdphd's topic in MySQL Help
The best thing you can do to speed up queries is to have the fields that are being JOINed ON, ORDERed BY, GROUPed BY, or used in a WHERE, properly indexed. Also learning to use EXPLAIN will help see where the bottlenecks are. http://www.sitepoint.com/optimizing-mysql-indexes/ -
I would like to read a dir of images and save the imagefile name to mysql
CroNiX replied to vet911's topic in PHP Coding Help
Since $files is an array, $i should start at 0, not 1 in the for() loop. You're skipping the first image. Please also note that the mysql extension is deprecated, meaning it will no longer be available in php in the future. If you want to write code that will work on future versions of php without having to rewrite all of your queries, it's highly suggested you use the PDO or mysqli extension. -
It's most likely on your server but just not enabled. Look in your php.ini in the extensions section and look for ;extension=php_mysqli.so (or .dll if windows) remove the ; from the front of the line and restart apache.
-
I'm honored! Thank you!
-
Is the js console showing the ajax request firing? Are you sure that data is being returned in the success event?
-
I believe your data is correct. An order can have many products, correct? What you'd need to do is in your loop when you are outputting the data, check to see if the order_id is the same as the last order_id, if not display the order_id, if so it's part of the same order and output a in the <td>. You'd probably want to ORDER your query by (orders.order_id, orders.company_id, orders.order_for) some pseudocode: $last_order_id = null; //store the last order_id while($row = $query->fetch_array()) { //check to see if this is a new order or part of the same one if ($row['order_id'] != $last_order_id) { //nope, it's a new order, store as $last_order_id and output the order_id $last_order_id = $row['order_id']; echo '<td>' . $row['order_id'] . '</td>'; } else { //it's part of the same order, output a space for this td echo '<td> </td>'; } } You'd need to do the same thing for anything else you don't want to repeat
-
Check the docs for your plugin. There is a callback function that executes after the animation has completed. That's the only way you'd be able to know when it completes.
-
Displaying users current details in form fields
CroNiX replied to Paul_Withers's topic in MySQL Help
And what does that tell you? You have a syntax error on line 10 (hint, usually the error is on that line, or the one right before it).