-
Posts
3,145 -
Joined
-
Last visited
-
Days Won
37
cyberRobot last won the day on May 21 2023
cyberRobot had the most liked content!
About cyberRobot
Profile Information
-
Gender
Not Telling
Recent Profile Visitors
91,164 profile views
cyberRobot's Achievements
-
Thanks for the clarification! I removed the line from my post.
-
As I'm sure you know, the learning process can be frustrating, especially when things don't seem to click...and/or when rushed to find a solution. Feel free to come back if you decide to tackle the problem again. To go along with Barand's suggestion, one option to show PHP errors is adding the following to the top of your script while debugging: <?php ini_set('error_reporting', E_ALL); ini_set('display_errors', 1); ?> Side note: the link below shows the PHP versions that are actively being supported. https://www.php.net/supported-versions
-
Are you getting the error when running Billing_Import.php? If so, have you looked into minimizing the queries executed within the foreach loop? I'm guessing that the script is running 31,000 select queries, for example. What about building a single query in advance...then running it after processing the 31,000 rows?
-
That's likely part of the PhpSpreadsheet solution being used. This is probably the GitHub repo: https://github.com/PHPOffice/PhpSpreadsheet/tree/master/src/PhpSpreadsheet/Cell
-
Were you able to fix the error? As requinix described, you are currently using the procedural style for calling mysqli_query(), which requires 2 arguments. You already included the query. Now you need to provide the database connection object, as the first argument. Based on the following line, your connection object is stored in $conn: $conn = mysqli_connect($servername, $username, $password); So, your call to mysqli_query() would look like the following: $query_result = mysqli_query($conn, $query);
-
Can connect to DB but can't extract data
cyberRobot replied to rtsanderson's topic in PHP Coding Help
It looks like you're using MySQLi to connect, but using the old MySQL functions for the rest. Note that the old functions were removed in PHP 7.0. See the warning here: https://www.php.net/manual/en/function.mysql-query.php -
PHP 8.1 How can I stop warning messages from displaying?
cyberRobot replied to SLSCoder's topic in PHP Coding Help
What about hiding all errors and warnings (on the production side) generated by PHP? Then write code to handle error cases the user is more likely to experience (e.g., incorrect login, invalid record ID, etc.) and output custom / user-friendly error messages. Side note: If you haven't already, you may want to consider the potential security impacts of outputting the raw PHP errors. https://www.php.net/manual/en/security.errors.php -
In case you are still looking for an answer, the issue might be caused by .background-image being defined twice. The definition in your styles.css is being ignored in this case, since you override all the rules in the <style> tag for the page. For example, the following rule from styles.css background-image: url(blueSunset.jpg); Is overridden by the following rule in the <style> tag: background-image: url('/blueSunset.jpg'); Note that the first rule says your image is in the same folder as the stylesheet...where the second rule says the image is in the root directory (note the slash). If the image isn't in the root directory, it won't show up.
-
You could use CSS (e.g., Flexbox or Grid) to accomplish that. Flexbox example: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_flexible_box_layout/Basic_concepts_of_flexbox Grid example: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_grid_layout/Basic_concepts_of_grid_layout CSS can also be used for zebra striping.
-
How can I get the page height which can change after element hiding?
cyberRobot replied to eaglehopes's topic in HTML Help
One option would be to write a function that gathers the necessary height information. Then run the function to initialize your height variable(s). If something is hidden after the initialization, run the function again to update the variable(s). You could also check to see if there's an event listener built into JavaScript for detecting changes to the page height. If something like that is available, you could have that run the necessary code to update the height information. For example, the "resize" event listener might be useful when gather height information when the user changes their browser's window size. More information can be found here: https://developer.mozilla.org/en-US/docs/Web/API/Window/resize_event Additional listeners may be available for other events that impact page height. -
Perhaps you already got this by Barand's response. If not, maybe this will help: Curly: ‘ ’ Straight: ' ' I should also mention that your original code posted at the top of this thread also had a curly double quote. Curly: “ ” Straight: " " Hopefully, you can see the curve in the curly quotes. Of course, the look of curly quotes are different based on the font used, as you may have noticed with Barand's response.
-
One thing I don't think was mentioned is to be wary of smart / curly quotes. I'm guessing those are remnants from copying code from a blog post. Be aware that PHP requires straight quotes. The following, for example, ‘expected-timeline-for-buying’ should be 'expected-timeline-for-buying'
-
Returning a value if blank in mysql with php
cyberRobot replied to PNewCode's topic in PHP Coding Help
Too be honest, I'm still not sure what $pageimg contains. My guess is that it contains the result object that's returned when you run the query. It's difficult to tell without seeing the code. $row["pageimg"] on the other hand will contain just the image name for whichever row (i.e., $row) is being processed by the loop extracting data from the result object. -
Returning a value if blank in mysql with php
cyberRobot replied to PNewCode's topic in PHP Coding Help
I believe that's what kicken was trying to help us figure out. Seeing how $pageimg is defined should let us know what the variable contains. You could add the following debug lines to see what the different variables contain: echo '<pre>' . print_r($pageimg, true) . '</pre>'; echo '<pre>' . print_r($row["pageimg"], true) . '</pre>';