Re: from excel to the mySQL
visit this site : http://www.daniweb.com/forums/thread119197.html --- On Tue, 8/3/10, Marc Guay marc.g...@gmail.com wrote: From: Marc Guay marc.g...@gmail.com Subject: Re: from excel to the mySQL To: HaidarPesebe haidarpes...@gmail.com Cc: MySQL Lists mysql@lists.mysql.com Date: Tuesday, August 3, 2010, 7:34 AM I'm needs a way to upload data from excel to the mySQL database. Dear all, I need help is how to upload data from excel columns and load into mysql database using php? http://www.sqldbu.com/eng/sections/tips/mysqlimport.html -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=samc...@yahoo.com
Error: Duplicate entry '0' for key 'PRIMARY'
Error: Duplicate entry '0' for key 'PRIMARY' how can i fix it ?
Re: Error: Duplicate entry '0' for key 'PRIMARY'
How do I modify the column to add value? Can I do it with phpmyadmin? --- On Mon, 3/2/09, Gary Smith g...@primeexalia.com wrote: From: Gary Smith g...@primeexalia.com Subject: Re: Error: Duplicate entry '0' for key 'PRIMARY' To: samc...@yahoo.com, mysql@lists.mysql.com Date: Monday, March 2, 2009, 1:58 PM Easy. Ensure that all in the primary key have unique values. With that said, it would be more useful to have a ddl and the query causing the problem. --Original Message-- From: sam rumaizan To: mysql@lists.mysql.com ReplyTo: samc...@yahoo.com Sent: Mar 2, 2009 12:56 PM Subject: Error: Duplicate entry '0' for key 'PRIMARY' Error: Duplicate entry '0' for key 'PRIMARY' how can i fix it ? Sent via BlackBerry by ATT
Re: Error: Duplicate entry '0' for key 'PRIMARY'
Are you talking about Length/Values1 --- On Mon, 3/2/09, Gary Smith g...@primeexalia.com wrote: From: Gary Smith g...@primeexalia.com Subject: Re: Error: Duplicate entry '0' for key 'PRIMARY' To: samc...@yahoo.com, mysql@lists.mysql.com Date: Monday, March 2, 2009, 1:58 PM Easy. Ensure that all in the primary key have unique values. With that said, it would be more useful to have a ddl and the query causing the problem. --Original Message-- From: sam rumaizan To: mysql@lists.mysql.com ReplyTo: samc...@yahoo.com Sent: Mar 2, 2009 12:56 PM Subject: Error: Duplicate entry '0' for key 'PRIMARY' Error: Duplicate entry '0' for key 'PRIMARY' how can i fix it ? Sent via BlackBerry by ATT
Re: Error: Duplicate entry '0' for key 'PRIMARY'
Thank you all I solved the problem --- On Mon, 3/2/09, Darryle Steplight dstepli...@gmail.com wrote: From: Darryle Steplight dstepli...@gmail.com Subject: Re: Error: Duplicate entry '0' for key 'PRIMARY' To: samc...@yahoo.com Cc: mysql@lists.mysql.com, g...@primeexalia.com Date: Monday, March 2, 2009, 2:32 PM Are you trying to do an Insert On Duplicate Key? Do ou want to insert a new row if it doesn't already exist or update one if it does? On Mon, Mar 2, 2009 at 4:09 PM, sam rumaizan samc...@yahoo.com wrote: Are you talking about Length/Values1 --- On Mon, 3/2/09, Gary Smith g...@primeexalia.com wrote: From: Gary Smith g...@primeexalia.com Subject: Re: Error: Duplicate entry '0' for key 'PRIMARY' To: samc...@yahoo.com, mysql@lists.mysql.com Date: Monday, March 2, 2009, 1:58 PM Easy. Ensure that all in the primary key have unique values. With that said, it would be more useful to have a ddl and the query causing the problem. --Original Message-- From: sam rumaizan To: mysql@lists.mysql.com ReplyTo: samc...@yahoo.com Sent: Mar 2, 2009 12:56 PM Subject: Error: Duplicate entry '0' for key 'PRIMARY' Error: Duplicate entry '0' for key 'PRIMARY' how can i fix it ? Sent via BlackBerry by ATT
drop down menu to a table
How do I insert data from a drop down menu (select box) to a table
LAST_INSERT_ID LAST_UPDATE_ID
How can I select (retrieve) the last updated cell (field). Basically I need to pull the new information only. I'm using for updating my database: UPDATE table SET column = CONCAT_WS ('column,' . $column.') WHERE column= value; I need to select data: SELECT * FROM table WHERE column=Whatever I found LAST_INSERT_ID but i doesn't work What I want to do is: 1-user has 10 columns (fields). 2- User updated one of these fields using CONCAT_WS(adding new data to previous data). 3- When user views any of his information he sees only the last updated part of the data. So, timestamp/datetime field is not going to work. - Ready for the edge of your seat? Check out tonight's top picks on Yahoo! TV.
Mysql and Textarea
I'm just a php beginner. So please be patient with my stupid questions. What am I missing in this code that causing the function cant update the textarea? Update button erase the old information from mysql database and replace it with nothing. Basically it cant read what is inside the Textarea box. Why?? Read the highlighted code. ?php include ('./includes/header.html'); include( '../mysql_connect.php' ); ? /HEAD BODY TABLE ALIGN=center BORDER=0 CELLSPACING=0 CELLPADDING=0 TR ALIGN=center VALIGN=middle TH ALIGN=centerFONT SIZE=6 COLOR =#310032View Existing Data/FONT/TH /TR /TABLE FORM METHOD=post ACTION=ved.php ?php $query = SELECT DISTINCT Assign_Engineer FROM lo_data; $result = mysql_query($query); ? BR /BR / CENTER SELECT NAME=ROPTION VALUE=NULLChoose a Category:/OPTION ?php while ($line = mysql_fetch_array($result)) { foreach ($line as $value) { echoOPTION VALUE='$value'; } echo $value/OPTION; } ? /SELECT INPUT TYPE=submit NAME=Submit VALUE=Submit DataBR /BR / ?php if (isset($_REQUEST['save_assign_engineer'])) { $id = (int) $_REQUEST['save_assign_engineer']; $job_title = mysql_real_escape_string($_REQUEST['Assign_Engineer'][' .$id . ']['Job_Title']); $sql = UPDATE `lo_data` SET `Job_Title` = ' . $job_title . ' WHERE `ID` = . $id; mysql_query($sql); } if (isset($_POST[R])) { $result = mysql_query(SELECT * FROM lo_data WHERE Assign_Engineer ='.$_POST[R].'); } ? DIV STYLE=overflow:auto; TABLE WIDTH=80 BORDER=1 CELLSPACING=1 CELLPADDING=3 BORDERCOLOR=CDCB98 THEAD TR STYLE=position: relative; top: expression(this.offsetParent.scrollTop); background-color: #CDCB98; THID/TH THReference No/TH THJob Descriptions/TH THCategory/TH THAssign Engineer/TH THDate Received/TH THDate Required/TH THDate Assigned/TH THProjected Completion Date/TH THDate Completed/TH THManhour Spent/TH THStatus/TH /TR /THEAD ?php $num=mysql_num_rows($result); echo $num; while($row = mysql_fetch_array($result)) { echo TBODY; echo TR VALIGN=\TOP\ ALIGN=\CENTER\; echo TD{$row['ID']}/TD; echo TD{$row['Ref_No']}/TD; echo 'TD PTEXTAREA NAME=Assign_Engineer[' . $row['ID'] . '][Job_Title] ROWS=10 COLS=40'.$row['Job_Title'] .'/TEXTAREA'; echo BR /; echo 'button type=submit name=save_assign_engineer value=' . $row['ID'] . ' /Updaet data/button '; echo TD{$row['Category']}/TD; echo TD{$row['Assign_Engineer']}/TD; echo TD{$row['Date_Received']}/TD; echo TD{$row['Date_Required']}/TD; echo TD{$row['Date_Assigned']}/TD; echo TD{$row['ProjectedCompletionDate']}/TD; echo TD{$row['Date_Completed']}/TD; echo TD{$row['ManhourSpent']}/TD; echo TD{$row['Status']}/TD; echo /TR; echo/TBODY; } ? - Luggage? GPS? Comic books? Check out fitting gifts for grads at Yahoo! Search.
index number of a specific cell
Is there a function in mysql to view the index number of a specific cell/field? For example if I want the index number for info4 or info7. Is it possible? Column 1 Column 2 Column 3 Column 4 Column 5 Info1 Info2 Info3 Info4 Info5 Info6 Info7 Info8Info9 Info10 Info11 Info12Info13 Info14 Info15 - Be a better Globetrotter. Get better travel answers from someone who knows. Yahoo! Answers - Check it out.
Mysql and Textarea
Can someone show me the mysql query statement to update the Text Area (the Text Area is populated with information from mysql) basically I want to allow the user to change or add information to the original data. scroll down to read the code. The text area I need to update is red font. !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; HTML HEAD ?php $page_title = 'View Existing Data'; include ('./includes/header.html'); include( '../mysql_connect.php' ); ? /HEAD BODY TABLE ALIGN=center BORDER=0 CELLSPACING=0 CELLPADDING=0 TR ALIGN=center VALIGN=middle TH ALIGN=centerFONT SIZE=6 COLOR =#310032View Existing Data/FONT/TH /TR /TABLE FORM METHOD=post ACTION=ved.php ?php $query = SELECT DISTINCT Assign_Engineer FROM lo_data; $result = mysql_query($query); ? BR /BR / CENTER SELECT NAME=ROPTION VALUE=NULLChoose a Category:/OPTION ?php while ($line = mysql_fetch_array($result)) { foreach ($line as $value) { echoOPTION VALUE='$value'; } echo $value/OPTION; } ? /SELECT INPUT TYPE=submit NAME=Submit VALUE=Submit DataBR /BR / ?php if (isset($_POST[R])) { $result = mysql_query(SELECT ID, Ref_No, Job_Title,Category,Assign_Engineer,Date_Received,Date_Required,Date_Assigned,ProjectedCompletionDate,Date_Completed,ManhourSpent,Status FROM lo_data WHERE Assign_Engineer ='.$_POST[R].'); } ? DIV STYLE=overflow:auto; TABLE WIDTH=80 BORDER=1 CELLSPACING=1 CELLPADDING=3 BORDERCOLOR=CDCB98 THEAD TR STYLE=position: relative; top: expression(this.offsetParent.scrollTop); background-color: #CDCB98; THID/TH THReference No/TH THJob Descriptions/TH THCategory/TH THAssign Engineer/TH THDate Received/TH THDate Required/TH THDate Assigned/TH THProjected Completion Date/TH THDate Completed/TH THManhour Spent/TH THStatus/TH /TR /THEAD ?php while($row = mysql_fetch_array($result)) { echo TBODY; echo TR VALIGN=\TOP\ ALIGN=\CENTER\; echo TD{$row['ID']}/TD; echo TD{$row['Ref_No']}/TD; echo TD FORM\nPTEXTAREA NAME={$row['ID']} ROWS=\10\ COLS=\40\{$row['Job_Title']}/TEXTAREABR /INPUT TYPE=\submit\ VALUE=\Update\INPUT type=\reset\/P/FORM/TD; echo TD{$row['Category']}/TD; echo TD{$row['Assign_Engineer']}/TD; echo TD{$row['Date_Received']}/TD; echo TD{$row['Date_Required']}/TD; echo TD{$row['Date_Assigned']}/TD; echo TD{$row['ProjectedCompletionDate']}/TD; echo TD{$row['Date_Completed']}/TD; echo TD{$row['ManhourSpent']}/TD; echo TD{$row['Status']}/TD; echo /TR; echo/TBODY; } ? /TABLE /DIV /FORM BR /BR / CENTER ?php mysql_close(); include ('./includes/footer.html'); ? /CENTER /BODY /HTML - Luggage? GPS? Comic books? Check out fitting gifts for grads at Yahoo! Search.
Object-Oriented database
Is there such thing call Object-Oriented database for mysql? Basically can I store an item as an object in myql? - Looking for earth-friendly autos? Browse Top Cars by Green Rating at Yahoo! Autos' Green Center.
Importing data from excel sheet
I have created table in mysql with 12 fields Field1Field2 Field3 Field4 Field12 I have an excel sheet with 12 columns and 150 rows. My question is how can I import all of the columns from the excel sheet to my table without losing any information. - Don't be flakey. Get Yahoo! Mail for Mobile and always stay connected to friends.
append information
I have a question if you don't mind. The update statement will replace the existing information. What if I have Textarea instead and I want to add information to the field without erasing previous information. Basically append information - Looking for earth-friendly autos? Browse Top Cars by Green Rating at Yahoo! Autos' Green Center.
insert data in to columns base on the selection of the list box.
Can you help me please? 1-I have created a while loop to populate the list box with the information of column1. 2-I need to update (insert data) in to column2, column3, column4 base on the selection of the list box. echo'form'; $query = SELECT column1 FROM table; $result = mysql_query($query); echobr; echobr; echocenter; echoselect NAME='R'; echooption value='NULL'Choose a Category:/option ; while ($line = mysql_fetch_array($result)) { foreach ($line as $value) { echoOPTION value='$value'; } echo $value/OPTION; } echo /select; echo /form; $sql=INSERT INTO table WHERE column1='.$_POST[R].' (column2, column3, column4)VALUES('info2', 'info3', 'info4'); $result=mysql_query($sql); - No need to miss a message. Get email on-the-go with Yahoo! Mail for Mobile. Get started.
The time of last updated field
I have to two different fields Last_Updated and Story. I want whenever Story Field got updated (modified) the time and date of the modification get recorded (insert) in Last_Updated Field - No need to miss a message. Get email on-the-go with Yahoo! Mail for Mobile. Get started.