Member Avatar

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in F:\xampp\htdocs\ajax\server.php on line 55 // Retrieve comments from database $sql = "SELECT * FROM comments"; $result = mysqli_query($conn, $sql); $comments = '<div id="display_area">'; while ($row = mysqli_fetch_array($result)) { $comments .= '<div class="comment_box"> <span class="delete" data-id="' . $row['id'] . '" >delete</span> <span class="edit" data-id="' . $row['id'] . '">edit</span> <div class="display_name">'. $row['name'] .'</div> <div class="comment_text">'. $row['comment'] .'</div> </div>'; } $comments .= '</div>'; ?>

+0 forum 0
Member Avatar

I have a Google map and a image lightbox slide show in the same page. After the page loads, the images and the map get loaded. map works normal. After I click on the image to make it bigger (lightbox) and then exit, the map is froozed and iresponsive. here is a link to a fiddle sample of it: https://jsfiddle.net/elamigosam/jd2hwfcr/61/ I was thinking to renaming all the functions, but not sure if that would do anything. also no errors in chrome console, and all the files load ok. P.S. I am not a javascript programer, but do understand basics.

+0 forum 0
Member Avatar

here is my table data.. here is my table data.. (4 Columns/1row in mysql table) id bno date results 310 001 02-15-2020 MI,108.53 Oh,194.57 PA,182.22 WA,238.57 How to split(statemiles) single column into (state, Miles) two columns and output like following 5 columns /4rows in mysql using php code. (5 Columns in mysql table) ------------------------------------------------------------------------------------ id bno date result1 result2 310 001 02-15-2020 MI 108.53 310 001 02-15-2020 Oh 194.57 310 001 02-15-2020 PA 182.22 310 001 02-15-2020 WA 238.57 --------------------- Following php code split two columns perfectly.. (screenshot below) ![separated_columns.jpg](/attachments/large/4/4bd9979bc3fb873826711f30f1a64c03.jpg) <?php //invoice.php include('../includes/config.php'); if(isset($_POST["add"])) { $order_no=$_POST['order_no']; $comma = preg_replace('/,\\s*/', "', …

+0 forum 0
Member Avatar

Hello, i have the following code: index.php <form role="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <label for="products">Product</label> <select id="products" name="products" class="user"> <?php require 'data.php'; $products = loadProducts(); foreach ($products as $product) { echo "<option id='".$product['id']."' value='".$product['id']."' selected>".$product['name']."</option>"; } ?> </select> <label for="bundles">Bundle</label> <select id="bundles" name="bundles"> </select> </form> Script <script type="text/javascript"> $(document).ready(function(){ $("#products").change(function(){ var aid = $("#products").val(); $.ajax({ url: 'data.php', method: 'post', data: 'aid=' + aid }).done(function(bundles){ console.log(bundles); bundles = JSON.parse(bundles); $('#bundles').empty(); bundles.forEach(function(bundle){ $('#bundles').append('<option>' + bundle.name + '</option>') }) }) }) }) </script> data.php <?php require 'DbConnect.php'; if(isset($_POST['aid'])) { $db = new DbConnect; $conn = $db->connect(); $stmt = $conn->prepare("SELECT * FROM bundles …

+0 forum 0
Member Avatar

I have always known that urlencode() encodes spaces as plus signs and rawurlencode encodes spaces as %20. However, I always struggled to know when to use which. I just finally learned today that you should use rawurlencode() if encoding URI paths and urlencode() if encoding query strings. Who woulda thunk it would be that simple?! :-P

+1 forum 0
Member Avatar

I have a basic html here, where you could just submit the button through an action page, so it inserts the record into the mysql database in phpmyadmin, what I want to know is how to make it auto submit after 5 mins, while setting the blanks fields value into "0" in the database. I am currently using wamp as my local server. Is there a best way how to do this? like using javascript or ajax? this is the html code <h2><font size="6s">GHS Applicant Assessment Tool</font></h2> <h5><font size="5s"><p>This exam is an assessment tool to help us place you in …

+0 forum 0
Member Avatar

Our CSS and JS files are not being re-downloaded by web browsers when we update them. The response headers look like this: cache-control: max-age=7776000 content-encoding: gzip content-type: text/css; charset=UTF-8 date: Sat, 01 Feb 2020 02:41:59 GMT etag: W/"5e34c19d-68a08" expires: Fri, 01 May 2020 02:41:59 GMT last-modified: Sat, 01 Feb 2020 00:09:01 GMT server: nginx/1.16.1 status: 200 vary: Accept-Encoding We want web browsers to cache them for 3 months, but we want them to expire the cache prematurely if the files have been modified. Shouldn't the ETag modify itself when the files are updated, and therefore when the Etag is different …

+0 forum 0
Member Avatar

<a style="position:absolute;" href='/Superuser/Plantincharge/dashboard.php'>Back</a> <h4 style="position: relative; left:95%;"> <button onclick="myFunction()">Print</button> <script> function myFunction() { window.print(); } </script> </h4> <h3 style="text-align:center; font-family: sans-serif; border-radius: 25px; border: 2px solid #73AD21; padding: 5px; width: 200px; height: 25px; position:relative; left:500px; overflow: hidden;">PROPOSAL No.</h3> <?php //////////////////////////////////////////// // Collecting data from query string $id=$_GET['id']; // Checking data it is a number or not if(!is_numeric($id)){ echo "Data Error"; exit; } // MySQL connection string require "dbconfig.php"; $count="SELECT * FROM createnearmiss where id=?"; if($stmt = $connection->prepare($count)){ $stmt->bind_param('i',$id); $stmt->execute(); $result = $stmt->get_result(); $row=$result->fetch_object(); echo "<table>"; echo " <table> <tr> <th>Details :</th> <td>$row->details</td> </tr> <tr> <th>Location :</th> <td>$row->location</td> </tr> <tr> <th>Date …

+0 forum 0
Member Avatar

![Scooch.gif](/attachments/large/4/13717be4f5be2345d3ca84ac1c6a79ce.gif) I am working on a page where I currently have a menu of 12 projects. On hover a project is underlined and on click a project expands vertically displaying a description. I have used a table to layout this menu. I wish to create a function where the menu is only able to expand untill a certain point, before it begin "filling up" the next column with the remainder of the menu. Below I have attached a mock-up GIF, showing the desired function. I have also pasted in some of my code. Please forgive my simplistic description, I am …

+0 forum 0
Member Avatar

Magento 1.9 - How to include custom PHP Script into .PHTML file My magento tracking page: https://i.stack.imgur.com/3GIoN.png Back-end magento code : https://i.stack.imgur.com/ySgMA.png How can i add my PHP script into this tracking page. Tracking page code - trackorder.phtml [ https://i.stack.imgur.com/ySgMA.png ] <?php if(Mage::getStoreConfig('trackorder/trackorder_general/enabled')): ?> <div class="page-title"><h1><?php echo $this->__('Track Your Order ') ?></h1></div> <div class="form-list"> <form name="track_order" id="track_order" action="" method="post" onsubmit="sendAjax('track_order','<?php echo Mage::getUrl('*/*/track');?>'); return false;"> <!--<form name="track_order" method="post" id="track_order" action="<?php echo Mage::getUrl('*/*/view');?>">--> <ul class="form-list"> <li> <label for="order_id" class="required"><em>*</em><?php echo $this->__('Order Id') ?></label> <div class="input-box"> <input type="text" name="order_id" id="order_id" value="" title="" class="input-text required-entry" /> </div> </li> <li> <label for="email_address" class="required"><em>*</em><?php echo $this->__('Email …

+0 forum 0
Member Avatar

How to use partial view as modal popup?

+0 forum 0
Member Avatar

Heres a pic of my database table ![Screen_Shot_2019-11-16_at_2_35_54_AM.png](/attachments/large/4/0749479693675147a0ccc8219b89e87f.png) Im trying to create a search page with drop down selectors to filter through each of the last 8 columns. I want the the drop down selectors to be able to select multiple entries (I have this working already) I also want them to preload values from data already entered into my table columns. (I also got this working with the help of tutorials... although I admit I don't fully understand how this part works) Using these tutorials i've created a php page that contains 8 drop down selectors that automatically pull …

+0 forum 0
Member Avatar

I am skilled in Core PHP, JavaScript, Mysql, Ajax, HTML, CSS, jQuery and Codeigniter and having 4+ years of experience in Web Development. I have very vast knowledge in dynamic and static website development.

+0 forum 0
Member Avatar

Please ask question and get to know answers from the Netizens about the ReactJs development. I'm also the learner of React JS and would like to seek job on that. Come join with me if you are looking for the same career.

+0 forum 0
Member Avatar

I have a search script that a user may search persons etc. I want to display a message if what he or types doesn't exist in the array. By default, I display some results and it displays the desired person when one writes on searchbar. but I want to show a message if what the user writes on searchbar doesn't much the array. the ngfor works perfectly I just can't show the message. I did a ngIf but doesn't show the #noThings when I type for example djlsklkssk. Note that userSet always has length > 0 because I call the …

+0 forum 0
Member Avatar

i wish to send another field together with my FormData, so after i googled it, they said to add append to my form data, done it. but it did not send anything to db including the content of the file. here is my code:- $('#upload_csv').on("submit", function(e){ var data = new FormData(this); data.append('test_filename', file); }); $.ajax({ url:"uploadfileprocess", method:"POST", data:{data,data}, contentType:false, cache:false, processData:false, success: function(data){ alert(data); if(data=='Error1') { alert("Invalid File"); } else if(data == "Error2") { alert("Please Select File"); } else { $('#importfiletodb').html(data); } } }) all the content and the file name should be able to save together when user click …

+0 forum 0
Member Avatar

Would appreciate some kind help here as I'm experiencing some issue with regards to sorting of result from my map database. I trying to use onchange="this.form.submit() to activate my dropdown sort function, but somehow I kept getting plain text display of the sorted result. However, it would work fine if I were to click on search & preset the sort(for example, if I set it to sort according to lowest price value & click on the search button, the sort result would show out as normal, as seen in the below screenshot). Would really appreciate if anyone of you could …

+0 forum 0
Member Avatar

Create a collection of these javascript files as an experiment to play with the language, or to solve problems for myself work.I also hope to give some help to those who need to use this script or save time searching the Internet and just starting to learn I would gladly accept pointers from others to improve, simplify, or make the code more efficient Welcome to join [project address github](https://github.com/gongmw/js-example) create-dir-if-not-there.js - Checks to see if a directory exists in the users home directory, if not then create it and automatically create parent directories. use-recursive-traverse-folder.js -Recursively traverse the folder files use-glob-traverse-folder.js …

+0 forum 0
Member Avatar

Hi everyone, I am trying to connect my html form to database using php pdo but everytime i try to submit my data it shows undefined

-1 forum 0
Member Avatar

I have a popup from index.ejs, called math.ejs. After pressing the submit Ok button, I want the math.ejs popup to close and to show the calculated value on index.ejs. But right now, when I press the submit button, the popup goes to index.ejs and updates it there; it does not close. It does not update it on the normal index.ejs browser page. I have to refresh that page for it to update. <form class="" action="/index" method="post" name="mathform"> <p>Value: <%= myValue %></p> <button class="btn btn-md" name="button" value="confirm" onclick="CloseAndRefresh();">Ok</button> </form> <script language="javascript"> function CloseAndRefresh() { opener.location.reload(true); setTimeout(function() { window.close(); }, 3000); } …

+0 forum 0
Member Avatar

Please I need your help, I am new to PHP and I need your help in inserting multiple select array into the database in the form of this. This is what I want to achieve. My table has 3 columns (id, examno, results). I want results column to be inform of subjects grades, subjects grades.........depending on the numbers of subjects and grades users select (e.g English C6, Mathematics C6) all in one column results. ## This is my html codes ## <form action="insert.php"> <div class="form-group"> <label>Exam Number</label> <input type="text" class="form-control" name="examno" id="examno"> </div> <table width="100%" cellpadding="0" cellspacing="0" border="0" class="table table-borderless" …

+0 forum 0
Member Avatar

Please I need your help, I am new to PHP and I need your help in inserting multiple select array into the database in the form of this. This is what I want to achieve. My table has 3 columns (id, examno, results). I want results column to be inform of subjects grades, subjects grades.........depending on the numbers of subjects and grades users select (e.g English C6, Mathematics C6) all in one column results. ## This is my html codes ## <form action="insert.php"> <div class="form-group"> <label>Exam Number</label> <input type="text" class="form-control" name="examno" id="examno"> </div> <table width="100%" cellpadding="0" cellspacing="0" border="0" class="table table-borderless" …

+0 forum 0
Member Avatar

Hello. I am having a problem here. So I have this slider which display the pictures with status "1" which means displayed. Here comes the problem, when there's no pictures with the status AKA "0" (not-displayed), the default image doesn't show up. Here's the script. <div class="carousel-inner"> <?php $no=1; $default=$this->db->get_where("penyaluran", array("status" => "1"))->result(); $g='image.jpg'; $n=''; foreach($default as $pict) { if ($g=$pict->foto_dokumentasi) { $n=$pict->nama_penyaluran; } else { $g='image.jpg'; $n= ''; } if ($no == 1) { $status = 'active'; } else { $status = ''; } ?> <div class="carousel-item <?php echo $status; ?>"> <img src="<?php echo base_url('uploads/'.$g); ?>" alt="" style="max-height: 300px; …

+0 forum 0
Member Avatar

Hi Dani, I am very much new in web development, i developed a page in bootstrap HTML and now i want to pull some data from mysql. i am able to pull data in php but not in HTML.

+0 forum 0
Member Avatar

Hello Coders, I am working on ASP.NET Web Forms. In my page there is a GridView which should have a feature to upload multiple files at the same time to the server. Can you help me in implementing this feature. I want: 1. The files should be uploaded from the GridView on the button click. 2. The upload button should be located on the footer of the GridView. 3. I want to do it in 2 ways - page postback pay and through AJAX. Thank you....

+0 forum 0
Member Avatar

I managed to get a certain PHP variable ($length) that contains the length of a message (stored in a MYSQL-database) to get passed to a javascript variable (var = length) in order to let javascript decide whether or not to show a certain marquee on a HTML-page. Initially I have used the javascript document.write statement to get the output displayed. However, using document-write "kills" the present HTML-page instead of integrating the marquee content into that HTML-page and keeping that HTML-page intact . So I have made some changes and the code I have sofar is the following: <script type="text/javascript"> var …

+0 forum 0
Member Avatar

love_you_21@21-VirtualBox:~$ python3 Python 3.6.8 (default, Jan 14 2019, 11:02:34) [GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import tkinter Traceback (most recent call last): File "<stdin>", line 1, in <module> ModuleNotFoundError: No module named 'tkinter' >>> >>> >>> >>>import Tkinter Traceback (most recent call last): File "<stdin>", line 1, in <module> ModuleNotFoundError: No module named 'Tkinter' >>> >>> >>> >>> what happen i don't know pls help Tkinter & tkinter both can't import

+0 forum 0
Member Avatar

hai all, i have 2 tables 1)state state contains stateid,statename here stateid is primary key. city contains cityid,cityname,stateid stateid is foreign key. 2)city now state contain 1 ap,2 tamilnadu,3 banglore. city contains chittor 1,madanapalle 1,tirupati 1 katpadi 2 ,kanchi 2 mysore 3 ,chintamani 3 when i select the ap city only shown in drop down list i dont have any code could you please help me any one .

+0 forum 0
Member Avatar

Greetings Digital Natives. I'm excited join this platform. I am a sofware developer at [Timbu](http://www.timbu.com/south-africa) Hoping to learning and connecting with you guys. I want to really upgrade my tech skills. I have stayed along in front end. I need to do little of backend and move with likeminded fellow.

+0 forum 0
Member Avatar

Hi, I do need help with my solo project called Salary Expenses project in PHP and Laravel and I don't see any data for the current month in the **Monthly Expenses page**, even the data is recorded during the current matching month. Can help? My project file: https://drive.google.com/open?id=11qrmVHOwdgiiYQbw981o4y_CNp9DrTUM

+0 forum 0

The End.