I'm somewhat new to coding websites. I'm trying to have a code where it pulls multiple images from a single database and displays it in a grid, not a table. At the top of my page I have a normal connection to the database. (very sorry about not having a code snippet, I'm new to daniweb and keep having errors when trying to use code snippets.) <div id="grid" class="grid-container"> <?php while ($row = mysqli_fetch_array($query)) echo '<div class="grid-item"> <p>'.$row['images'].'</p> <p>'.$row['project'].'</p> <p>'.$row['summary'].'</p> </div>'; ?> </div>

Member Avatar
Member Avatar
+0 forum 1

Hello i have a mysql statement and i want to add more parameters to get different results. SELECT DISTINCT M.message,F.friend_one,F.friend_two, F.role,U.uid,U.username FROM users U,friends F, messages M WHERE ( U.status='1' AND F.friend_one = '88') OR (F.friend_two='88' ) AND F.role='friend' 88 is the users id so i want to show M.message from friends of 88 but not 88 itself hints: when one is becoming friend with other friend_one is 88 -for example- and friend_two another user id or vice versa M table has id of user as a column of course

Member Avatar
Member Avatar
+0 forum 4

$query = "INSERT INTO 'user-profiles' ('name', 'avatar', 'description', 'votes', 'pay_methods', 'location', 'user_id') VALUES ('sadj', 'qwesad', 'sadqwdqw', '0','sadsad', 'sadasdsad''4')"; $resultprof = $this -> conn -> query($query); votes and user_id are INT columns, and user_id is a foreign key. Making this insert on mySQL directly it works perfectly, but on my PHP the "success" is false....

Member Avatar
Member Avatar
+0 forum 5

Hi all, I am very new to PHP and MYSQL and have a class assignment I need help with. I am trying to make a page with an HTML form that will update my MYSQL database. You can view my pages online here: [URL="http://baileyjumper.aisites.com/Scripting-Week7/homework4/exercise-five.php"]http://baileyjumper.aisites.com/Scripting-Week7/homework4/exercise-five.php[/URL] I need help with the "Edit" section, if you look online. Here is the code for my Edit page: [CODE=PHP] <?php $hostname = "localhost";//host name $dbname = "baileyjumper_imd203";//database name $username = "baileyjumper_imd";//username you use to login to php my admin $password = "chris4ever";//password you use to login //CONNECTION OBJECT //This Keeps the Connection to the Databade …

Member Avatar
Member Avatar
+0 forum 20

If a bulk MySQL insert takes 5 minutes to complete, and one of the columns in the table is a TIMESTAMP column with a default value of CURRENT TIMESTAMP, will the timestamps of the rows that were inserted be reflective of the entire 5 minutes, or will they all default to the same timestamp from beginning or the end of the query? The bulk insert exists within a transaction.

Member Avatar
Member Avatar
+0 forum 3

Hi, In my application two fields are the user id and user name,i want to show the user name and user id along with other details in a html table. user id is a numeric dropdown menu and user name is text only.How can i show the specfic record in that table for that user which i have selected in both of the fields ,how i can fetch data from backend User table?am using html,css and javascript, Any suggestion would be grateful!Thanks..

Member Avatar
Member Avatar
+0 forum 1

Hello i have a project that uses firebase but i want to make connect to my MySql database on xampp. Any idea what to do?

Member Avatar
Member Avatar
+0 forum 1

hi, I am stuck trying to figure out how to build a table to display agents names, (that I already have, mysql table etc...) but now I need to add columns dynamicaly. I need to add (programs in witch agents are enroled, and a status of the program ( in-progress, not-done, etc). The part that I can figure out is where would I save the status of the agent in the program. I have enroled-agents table: (id, name, email) displays a basic mysql-php-html table; then I have programs table: (id, name, description, avaiable-status) When i place them together, where how …

Member Avatar
Member Avatar
+0 forum 4

I have a database of pictures, and votes. The pictures database has up_votes and down_votes culomns. I want to create a system using MySQL to get hot and trending pictures just like 9Gag. How can I do that?

Member Avatar
Member Avatar
+0 forum 13

Hello, I am looking for a new IDE. I am currently using netbeans to develop a website in php/mysql. I like a lot of things about netbeans, but I don't like that it doesn't come with built in compilers/debuggers. You have to manually go and add/link them on a language-by-language basis. This isn't too bad in theory, but sometimes it doesn't work like it should, which can cause a huge headache. I had a hell of a time getting a debugger to work for php. I am now adding javascript/jquery to the website, and discovered that the debugger I already …

Member Avatar
Member Avatar
+0 forum 3

I have been cracking my head on this mater in the past couple of days. I am faced with a situaton where i need to write a MySQL equivalent of PHP code to loop through sql select results. The Php code looks like this $query = "SELECT pubid, author FROM refs"; $sql=$con->prepare($query); $sql->execute(); $sql->setFetchMode(PDO::FETCH_ASSOC); while ($row=$sql->fetch()){ $id= $row['pubid']; $author = $row['author']; $name = explode('., ', $author); } How can one write sql/mysql query that does the same?

Member Avatar
Member Avatar
+0 forum 6

I was attempting to store chat logs in a MySQL database where the message field is utf8_general_ci However, when it came across an emoji, it would choke, and the message field would only include text up to the emoji character. I changed the message field to be utf8mb4_general_ci, which seemed to be suggested upon googling, and now emoji characters are replaced in the database with four question mark characters, instead of choking. What is the best way to encode/decode emoji characters so that they can be accurately represented? (Ideally with PHP)

Member Avatar
Member Avatar
+0 forum 6

I got a syntax error flag in my "users" database table, but can't figure the issue out. Please, I need your help. The following is the error message: Error SQL query: --------------------------------------------------------- -- -- -- Table structure for table `users` -- CREATE TABLE IF NOT EXISTS `users` ( `user_id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT , `username` VARCHAR( 255 ) COLLATE utf8_unicode_ci NOT NULL , `firstname` VARCHAR( 32 ) COLLATE utf8_unicode_ci NOT NULL , `lastname` VARCHAR( 32 ) COLLATE utf8_unicode_ci NOT NULL , `email` VARCHAR( 255 ) COLLATE utf8_unicode_ci NOT NULL , `phone` VARCHAR( 30 ) COLLATE utf8_unicode_ci NOT …

Member Avatar
Member Avatar
+0 forum 2

I have a list.php which displays all the records that is in the database with 2 options Edit or Delete. When clicked its suppose to delete by id but instead it deleted everything. I'm not sure where i went wrong, please help. list.php <?php include "db.php"; try { $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $stmt = $conn->prepare("SELECT * FROM myguestbook"); $stmt->execute(); $result = $stmt->fetchAll(); //fetchAll() function will grab the query result and store it in an associative array $result. grab more than one record. } catch(PDOException $e) { echo "Error: " . $e->getMessage(); } $conn = null; ?> …

Member Avatar
Member Avatar
+0 forum 5

Is the method in MySQL to set in SQL script dynamic log file name? e.g in Oracle PL/SQL set define on column sdate new_value sdate select to_char(sysdate,'YYYY.MM.DD_HH.MI') sdate from dual; spool 'logs/install_&sdate..log'; e.g. in PG/SQL \o ./logs/install_`date +"%Y-%m-%d_%H%M"`.log but I cant find similar in MySQL \T ??????

Member Avatar
Member Avatar
+0 forum 6

//The php section of the code <?php function getJSONFromDB($sql){ $conn = mysqli_connect("localhost", "root", "","rent"); //echo $sql; $result = mysqli_query($conn, $sql)or die(mysqli_error()); $arr=array(); while($row = mysqli_fetch_assoc($result)) { $arr[]=$row; } return json_encode($arr); } $jsonData= getJSONFromDB("select Pic from Display"); $jsn=json_decode($jsonData); //for loop to retrieve rows from database for($i=0;$i<sizeof($jsn);$i++){ $a=$jsn[$i]->Pic; //here is the main problem echo "<html><body><img src='sponsor/$a.jpeg' alt=''></body></html>"; //here is the problem i am facing } ?> 01 //The php section of the code 02 <?php 03 function getJSONFromDB($sql){ 04 $conn = mysqli_connect("localhost", "root", "","rent"); 05 //echo $sql; 06 $result = mysqli_query($conn, $sql)or die(mysqli_error()); 07 $arr=array(); 08 while($row = mysqli_fetch_assoc($result)) { 09 $arr[]=$row; …

Member Avatar
Member Avatar
+0 forum 1

Hi i am having 3rd party csv file. i am having php uploading script to upload the datas into my table. while uploading datas into my mysql Table mean while it has to remove duplicate entries rows from CSV file. Please help me

Member Avatar
Member Avatar
+0 forum 21

Hi, I have problem to count a multiple condition in one query. Usually i have to select count it one by one just like this : SELECT COUNT(kod_urusan) as num1 FROM customer_info WHERE kod_urusan = '0001' SELECT COUNT(kod_urusan) as num2 FROM customer_info WHERE kod_urusan = '0002' SELECT COUNT(kod_urusan) as num3 FROM customer_info WHERE kod_urusan = '0003' Is there any way to put all this query in one query? So the result of the count should be in 3 column.

Member Avatar
Member Avatar
+0 forum 1

I know how to do a fetch array to create a while loop as well as the mysql query in ASC order. What I'm trying to sort out is how I might be able to make it create the ASC order but to ignore the initial words "The" or "A" in the results example if the records have -Running Around -The End Game -A Robotic Arm -Mighty Mouse I want the result to show 1. The End Game 2. Might Mouse 3. A Robotic Arm 4. Running Around when it shows me the listed results in ASC order Thanks for …

Member Avatar
Member Avatar
+0 forum 2

Hey everyone, I have been going over this in my head and can't seem to figure out the solution. I've got a database table called brands and in my form I'm trying to get it to where when I edit a brand, I can't edit it into an already existing brand. My code just automatically adds the new brand even though it exists as well as adds the existing brand as a new brand if I were to retype the existing brand. I hope that makes sense.. Basically I want to check if a brand exists in the database based …

Member Avatar
Member Avatar
+0 forum 4

HI,everyone , I m stum in this question for long time, could somebody help me out, my output is success ,but the arrange in table is wrong. below is my code.. <?php $no_pensyarah=$_SESSION['no_pengguna']; $tahunsemasa =date('Y'); include '../includes/dbconnect.php'; $sql_rekod = "SELECT a.*,b.nama_subjek,c.nama_kursus FROM info_subjek_pensyarah as a, subjek as b,kursus as c WHERE a.kod_subjek = b.kod_subjek AND a.kod_kursus = c.kod_kursus AND tahun_bahagian LIKE '$tahunsemasa%' AND no_pensyarah = '$no_pensyarah'"; $result_rekod = mysql_query($sql_rekod) or die('Query failed. ' . mysql_error()); $tmpCount = 1; while($row = mysql_fetch_assoc($result_rekod)) {?> <?php $nama_kelas = $row['nama_kelas']; ?> <tr> <td><?php echo $tmpCount; ?></td> <td><?php echo $row['kod_kursus']; ?></td> <td><?php echo $row['nama_kursus']; ?></td> …

Member Avatar
Member Avatar
+0 forum 1

I am trying to retrieved data from database and update a single column. column1 | column2 | column3 value1 | value1 | ------- value2 | value2 | ------- <=== this column3 rows does not have value in database yet so it will be blank when I retrieved the data Now I would like to update column3 rows by putting values to it and send it back to the database with the new value in column3 rows. The current code that I am using now can only retrieved and update a single ID and I'm stuck here. What I want to …

Member Avatar
Member Avatar
+0 forum 21

Hi, i have installed prestashop 1.4.8.2 & i need a report of first order date for each customers, please help me to create mysql query. i need below columns information from database. id_customer, firstname, lastname, first order date thanks, Ritesh

Member Avatar
Member Avatar
+0 forum 12

I currently have some code that gets the overall top 25 frame sales, which is as follows: `Dim FrameCountSelectStr As String = "SELECT TOP 25 Count(Glasses.OrderID) AS GlassesCount, Glasses.Manufacturer, Glasses.FrameName FROM(Glasses) WHERE FrameName <> '' AND OrderDate >= #" & SearchDateStart & "# AND OrderDate < #" & SearchDateEnd & "# GROUP BY Glasses.Manufacturer, Glasses.FrameName ORDER BY Count(Glasses.OrderID) DESC"` What I would also like to do is get the top 25 frame sales for each DISTINCT company and group the results by company (and order by count). I tried the following but I am not having any luck: `Dim FrameCountSelectStr …

Member Avatar
Member Avatar
+0 forum 6

hey guys I'm doing lms project. I created login page and php file. I can't find where I stucked. Here explanation of login form : * Check whether given username and password correct or not.. * If correct then check user type... * redirect to different pages according to user's faculty... here my php code : <?php session_start(); $db=mysql_connect("localhost","root","") or die("error : ".mysql_error()); if(isset($_POST['btn_log'])) { $username=$_POST['username']; $password=$_POST['password']; mysql_select_db("lms"); $query = mysql_query("select * from lms.user"); while($row = mysql_fetch_assoc($query)){ if(($row['user_name']==$username)&&($row['password']==$password)){ if($row['u_type']=="admin"){ $_SESSION['username']=$username; $_SESSION['password']=$pass; header("location:lec_dash.php"); } else if($row['u_type']=="user"){ if($row['faculty']=="School of Computing") { header("location:modules_SOC.php"); } else if($row['faculty']=="School of Business") { header("location:modules_SOB.php"); } else if($row['faculty']=="School …

Member Avatar
Member Avatar
+0 forum 2

Hello to all, I am trying to display the images on my page through php from mysql database Problem is - Images are repeating , It always display only first image. <?php include("header.php"); include("connection.php"); $sql = "select Image from flood_light"; $result = $conn -> query($sql); if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { ?> <!--header//--> <div class="product-model"> <div class="container"> <ol class="breadcrumb"> <li><a href="index.html">Home</a></li> <li class="active">Products</li> </ol> <div class="col-md-9 product-model-sec"> <a href="single.html"><div class="product-grid"> <div class="more-product"><span> </span></div> <div class="product-img b-link-stripe b-animate-go thickbox"> <?php echo '<img src="images/'.$row[1].'"/>'; ?> <div class="b-wrapper"> <h4 class="b-animate b-from-left b-delay03"> <button><span class="glyphicon glyphicon-zoom-in" aria-hidden="true"></span>Quick View</button> </h4> </div> </div></a> …

Member Avatar
Member Avatar
+0 forum 6

I have been butting my head against this problem for the past 4 hours, and I have to tap out. I know I can't be too far from correct I am just not sure what the missing ingredients are. Here is the problem question: Student status: List of all students and their enrollment status Fields: student last name and first name (comma separated), years enrolled, academic advisor last name and first name (comma separated) Sort: years enrolled Input: none Filter: only include currently active students and My code: SELECT student_id,std_l_name, std_f_name, faculty_l_name, faculty_f_name,student_id_fk,enroll_date,MONTHS_BETWEEN(CURRENT_DATE ,enroll_date) V1: FROM STUDENT, FACULTY,ENROLLMENT WHERE FACULTY.faculty_id=STUDENT.faculty_id_fk3 …

Member Avatar
Member Avatar
+0 forum 2

Hello Am looking for an out-of-the-box Wordpress theme which can help me create a website similar to either FileHorse or FileHippo in a very short time. Any one has an idea?

Member Avatar
Member Avatar
+0 forum 4

As I am doing a application on attendance management where I need to store the details by using check boxes I am unable to store the details of check boxes where it will be generated as present or absent in database Can anyone help me to find out this

Member Avatar
Member Avatar
+0 forum 4

hello everyone [{ "uid": "BR-M12068", "registeredDate": "Thursday May 11th 2017 03:56:37 PM", "file_path": "BR-M12068.pdf", "file_thumbnail_path": "BR-M12068thumb.png", "test_type": "Free", "title": "Medical Bills", "createdAt": "Thursday June 29th 2017 05:02:19", "chkTime": "Thursday June 29th 2017 05:01:53 PM", "chkoutTime": "Thursday June 29th 2017 05:02:29 PM" }, { "uid": "BR-M12068", /// first data "registeredDate": "Thursday May 11th 2017 03:56:37 PM", "file_path": "BR-M12068.pdf", "file_thumbnail_path": "CEthumb.png", "test_type": "not-free", "title": "Medical Bills", "createdAt": "Sunday June 25th 2017 02:29:38", "chkTime": "Sunday June 25th 2017 02:28:22 PM", "chkoutTime": "Sunday June 25th 2017 02:30:07 PM" }, { "uid": "BR-M12068", //second data "registeredDate": "Thursday May 11th 2017 03:56:37 PM", "file_path": "BR-M12068.pdf", "file_thumbnail_path": …

Member Avatar
Member Avatar
+0 forum 6

The End.