7,368 Topics

Member Avatar for
Member Avatar for SoMa_2

I have images generated by while loop php based on how many course user have when user press on one of those images it will send him to that course page but all images send to one course page this my php code in** home page ** <?php $con=mysqli_connect("localhost","FYP","123","FYP"); $sql= …

Member Avatar for diafol
0
2K
Member Avatar for Simon180

I have a small issue with following code am inserting a new room into mysql using query and then I want it to auto join the room once its made but the problem is when room is in process of being made it will call the GoTo procedure and it …

Member Avatar for Simon180
0
279
Member Avatar for phoenix254

Hi, i want to change format of date . This code i add in my register page.... if(!empty($_POST['dob'])&& !empty($_POST['mob'])&& !empty($_POST['yob'])) { $yob = mysqli_real_escape_string($con,$_POST['yob']); $mob = mysqli_real_escape_string($con,$_POST['mob']); $dob= mysqli_real_escape_string($con,$_POST['dob']); $date = mysqli_real_escape_string($con,"$yob-$mob-$mob"); $addtothedb="INSERT INTO login (Dateofbirth) VALUES ('". $date . "')"; $result=mysqli_query($con,$addtothedb); and when i get back data from db …

Member Avatar for cereal
0
412
Member Avatar for mbarandao

Hello, I was wondering if the following mysql query can be constructed in a much more efficient way? SELECT distinct(cr.email), m.fname, m.lname, m.email, (SELECT count(*) FROM campaignRecipts where email=cr.email )as ttlsent, (SELECT count(received) FROM campaignRecipts where received='yes' and email=cr.email )as ttlreceived, ((SELECT count(received) FROM campaignRecipts where received='yes' and email=cr.email )/(SELECT …

Member Avatar for mbarandao
0
357
Member Avatar for logicaweb

I'm trying to make average consumption of fuel in my db. But I do not know how to do it. This is an little explanation: I have 2 tables: Tabe CONSUM: ID CARID LI KM DATETIME ------------------------------------------------ 6 9 70.17 174857 2015-02-10 10:58:51 5 5 51.00 154785 2015-02-09 19:11:19 4 …

Member Avatar for kalxas
0
231
Member Avatar for AntonyRayan

Hi, How to calculate no of days working of an employee and no of days absent in a current month.

Member Avatar for kalxas
0
373
Member Avatar for ramsiva

I am getting id's 3 times. count will be 3 but i am getting 9. i dont know where i did mistake. any body help me $result = mysql_query("SELECT * FROM candidate where user_id ='$username' and password='$password' and status='0' " ); $num=mysql_num_rows($result); if($num>0) { $row1=mysql_fetch_array($result); $cand_id=$row1['cand_id']; $f_mobile=$row1['f_mobile']; $d2=mysql_query("select * from …

Member Avatar for kalxas
0
178
Member Avatar for SoMa_2

I'm trying to create a webpage to help teacher determine CLO and PLO for exam questions First user will type the keyword in text box and select the chapter CLO() function will start the AJAX the result should be a CLO Number in CLO column and PLO options in PLO …

Member Avatar for asgs
0
356
Member Avatar for uchejava

I need your suggestion on something. I want to display a 'message notification' on my menu bar. I want it to be like the Facebook message notification. When I have a new message, '1' should show close to the message menu e.g. 'Message 1' (I can use CSS to style …

Member Avatar for Eagle.Avik
0
204
Member Avatar for rchawdhari
Member Avatar for AleMonteiro
0
176
Member Avatar for phoenix254

$result = mysqli_query($con,$addtothedb); $cur = "USERS/"; echo $des = $cur.$email.'/'; if($result){ if ( mkdir($des,0777) ) { //http://pastebin.com/7J0BM5fD echo "<br/>"; echo "<br/>"; echo $file_name = $_FILES['file']['name']= 'mfix.png'; echo "<br/>"; echo "<br/>"; echo $file_tmp =$_FILES['file']['tmp_name']= 'mfix.png'; echo "<br/>"; echo "<br/>"; move_uploaded_file($file_tmp, $des.$mfix); echo "<img src='<?php echo $mfix ;?>' alt='Image' style='width:100px;height:100px'>"; /*echo "<img …

Member Avatar for phoenix254
-1
197
Member Avatar for phoenix254

<?php $con=mysqli_connect("localhost","root","","uplod"); if (mysqli_connect_error()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } else{ echo work $sql ="UPDATE tea SET name = ' 8req' WHERE id = '3 ' "or die ("cant update" . mysql_error()); if($sql) echo"working"; } ?> Who can tell me which is error is the …

Member Avatar for phoenix254
0
221
Member Avatar for Kcachilove

Hello I have an SQL query that i want to concatenate the fields and display it in a way that those concatenated fields will be displayed first row will have 4 columns,second row will also have 4 columns....etc. for instance the query `SELECT imageurl, caption, template FROM template; The Result …

Member Avatar for anejose
0
1K
Member Avatar for Andrew de Beer

Hi All I use MS Access to import information from Excel, check for duplicates and post it to an Access data table. The amount of data is making this process extremely slow. I am attempting to move the data tables to MySQL and then running a Stored Procedure to do …

Member Avatar for DaveAmour
0
171
Member Avatar for rouse

I’m trying to patch a routine and I finally found the problem. I am given the following string: [code] $query = "SELECT title, DATE_FORMAT(event_date, '%Y-%c-%e') AS event_date FROM $dbTable WHERE event_date LIKE '$year-$month%'"; [/code] In the month variable at the end, for the months January through September I am returned …

Member Avatar for rouse
0
316
Member Avatar for rouse

I am looking for help to write a query. I have a database with an ID a Date_Field and a Description. I want to find out two things What Date_Field and Description and Description are the same? {duplicate records} [code] SELECT * FROM TIME_TABLE t1 WHERE EXISTS ( SELECT * …

Member Avatar for rouse
0
169
Member Avatar for rouse

I the found the link below when I was researching how to get a random record for a database. This article is about speed in retrieving a random record and I found in my test that speediest solution brought about the most duplicates. [url]http://akinas.com/pages/en/blog/mysql_random_row/[/url] I am hoping some one has …

Member Avatar for rouse
0
99
Member Avatar for UK-1991

I have created a vendors page where I want to show how many vendors exist in the database. I have succcssfully done but main problem is that how do i show that which vendor contains how many products There are 2 tables I have created 1 is products 2nd is …

Member Avatar for UK-1991
0
218
Member Avatar for James_43

Hi all, I am trying to populate text on my website from data stored in a MySQL database. I have this script before the <head> of my HTML to establish the connection: <?php $username = "USERNAME"; $password = "PASSWORD"; $hostname = "127.0.0.1:3306"; //connection to the database $dbhandle = mysql_connect($hostname, $username, …

Member Avatar for jj.dcruz
0
299
Member Avatar for phoenix254

if ($count == 1){ $suc= move_uploaded_file($file_tmp, $destin.$file_name); echo"<br/>"; $query = mysqli_query($con,"INSERT INTO login ( profile_img) VALUES ('$file_name') WHERE useremail='".$_SESSION["sess_useremail"]."'") or die("can t still upload ".mysql_error());}

Member Avatar for pritaeas
0
174
Member Avatar for amogh.max

I have the followiing data in my database(mysql) [img]http://i.imgur.com/jy3ryVk.png[/img] i want to represent then in a simple bar chart row after row with 2 sec interval(looks like dynamic).I am using jsp for my website.Code appreciated.

Member Avatar for AleMonteiro
0
63
Member Avatar for hwoarang69

below, I have created 4 tables using oracle sql. I want to change the code so that when deleting a student will delete all enrollments for that student. any idea how can I do this? # COURSES table # CREATE TABLE COURSES (COURSE VARCHAR(6), DESCRIPTION VARCHAR(60), CREDITS INT, CONSTRAINT pk …

Member Avatar for diafol
0
224
Member Avatar for berserk

I am in need of help on this one :( i cannot seem to figure out what i have done wrong, i set up my code just like in teh examples i read and i dont really see anything wrong with the logic (as far as i can tell) but …

Member Avatar for berserk
0
314
Member Avatar for DGULLIVER

Hi, I want to create a SP in mySQL to insert records and return the Primary Key. But when I try and create the SP I get error: mysql said #1064, You have an error in your SQL Syntax, Check the manual that corresponds to your MySSQL server version for …

Member Avatar for pritaeas
0
6K
Member Avatar for jj.dcruz

I'm using pure php for the moment and I'm having a problem on what to do next using the command `DESCRIBE` calls all the header of my database but I cannot call those datas under the headers I have to manually put it. What I want to know is: * …

Member Avatar for jj.dcruz
0
292
Member Avatar for fthmad

I was designed a database model for my social network project. It has follower system. If you follow him the follower can see the status. All these operations are for one page. (This page is name **user_wall.php**) Its has a GET value and this is **userName**. For this case about …

Member Avatar for fthmad
0
558
Member Avatar for ruhestorer

Hi, I have a problem with exercise 51 from sql-ex.ru, please help. Thanks in advance. # Short database description "Ships" # The database of naval ships that took part in World War II is under consideration. The database has the following relations: Classes(class, type, country, numGuns, bore, displacement) Ships(name, class, …

Member Avatar for SOURABH_2
0
1K
Member Avatar for Kubilay Doğukan

This is the table that gives error -- ----------------------------------------------------- -- Table `mydb`.`Supervise1` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `mydb`.`Supervise1` ( `S1_Date` VARCHAR(45) NOT NULL, `S1_Contracter` VARCHAR(45) NOT NULL, `S1_Contractee` VARCHAR(45) NOT NULL, `S1_ID` VARCHAR(45) NOT NULL, PRIMARY KEY (`S1_Contracter`, `S1_Contractee`, `S1_Date`, `S1_ID`), INDEX `Contracter_idx` (`S1_Contracter` ASC), INDEX `Contractee_idx` (`S1_Contractee` …

Member Avatar for Kubilay Doğukan
0
281
Member Avatar for uchejava

I am trying to save 2 photos to my MySQL database. I can only see one of the 2 photos in the database (i.e. its name) but I see the 2 photos in the folder I store my photos. ( A picture of how the database looks like is attached.) …

Member Avatar for amith_ami
0
202
Member Avatar for uchejava

I am trying to compare IF statements. if ($_POST['price'] =="see all"){ //show okolo } else if ($_POST["accommodation"] =="see all"){ //show chibuzo } This works but as soon as I add: else if ($_POST['price'] =="see all" AND $_POST['accommodation"]=="see all"){ //show henry } This stuff does not work, it now shows "okolo" …

Member Avatar for uchejava
0
119

The End.