insert

INSERT IGNORE Inserting 0 rows

Hi Everyone: When I am attempting to run "INSERT IGNORE ..." in MYSQL to add only one variable to a table of several options, after the first insert, it refuses to work. It says "Inserted rows: 0" and doesn't insert my new value into the database. I believe this is because there is already an entry with a "nothing" value and MYSQL doe...

jquery inserting html doesn't work

I have got a table where i want to insert html in a td on the next row. I pasted one row below. <tr class="content"> <td align="center"> <a class="version" href="theurl">click here to update the td in the row below</a> </td> <td align="left">col 2</td> <td align="left">col 3</td> <td align="left">col 4</td> ...

What is the most efficient way to insert thousands of records after a click event?

Hai guys, I ve developed a web application using asp.net and sql server 2005 for an attendance management system.. As you would know attendance activities will be carried out daily.. Inserting record one by one is a bad idea i know,my questions are Is Sqlbulkcopy the only option for me when using sql server as i want to insert 100 rec...

MySQL How to insert new record or update a field depending on whether it exists?

I am trying to implement a rating system where I keep the following two fields in my db table: rating (the current rating) num_rates (the number of ratings submitted so far) UPDATE mytable SET rating=((rating*num_rates)+$theRating)/num_rates, num_rates=num_rates+1 WHERE uniqueCol='$uniqueCol' the variables are from my PHP code. So, b...

Characters to use for \r\n when inserting into SQL Server

I'm attempting to insert some data from MySQL to SQL Server. I've dumped the MySQL table to a text file as SQL insert statements. I can insert it into SQL Server ok but the carriage returns are inserting as \r\n rather than as control sequences. How can I replace the \r\n strings in the MySQL insert statements so that they will end up as...

JQuery: How to Extract Element and insert Text/Element before the extracted Element?

Hallo, I would appreciate your advice. Given the following snippet: <div id="parent"><div id="child">ChildText<span id="subchildtext"><b>SubChildText</b></span></div></div> I want to: Extract the span Element ==>var span = $("#child").find("span"); Prepend some Text ("foobar") and a new HTML element ("<b>foorbarbold</b>) ==>span.in...

SQL Server generate unique value

SQL Server 10, .NET, C# This is similar to this question but not exactly the same. When a user creates new event on my event-scheduling web site, a unique sort-of easy to remember code is to be generated, so this code can be communicated (via the phone, let's say) to the participants. This generated code looks something like: JohMon...

How to insert <script> with Prototype?

I'm using Prototype insert function to appent some html which contains <script>...</script>. And within this script I'm defining a new function. And as I read here Prototype runs script that is inside <script> tags and then removes it, but all functions should remain accessible. But from that moment I can't run my new function. $('som...

Insert/Select with Linq-To-SQL

Is there a way to do an insert/select with Linq that translates to this sql: INSERT INTO TableA (...) SELECT ... FROM TableB WHERE ... ...

INSERT-ing multiple rows

I have the following sql code. Is it guaranteed that MyTable is going to be sorted by MyTable.data? Basically the question is - if I am inserting multiple rows with one INSERT statement, can other connection get in the middle of my insertion and insert something else in between my rows? CREATE TABLE MyTable( id bigint IDENTITY(1,1) ...

Python and SQLite: insert into table

I have a list that has 3 rows each representing a table row: >>> print list [laks,444,M] [kam,445,M] [kam,445,M] How to insert this list into a table? My table structure is: tablename(name varchar[100], age int, sex char[1]) Or should I use something other than list? Here is the actual code part: for record in self.server: ...

DefaultButton="InsertButton" on <asp:ListView>

In a when there are no rows and user enter values and hit Enter after last value then new row is inserted (like it should be) But then the Delete button of the first row become the default button for the ListView and when user hit Enter on following rows first row in ListView is deleted. I have tried to use surrounding both the ItemT...

Getting table entry index

I can't get table entry index. I need it to remove an item from table. I use table.insert to add entries to table. Another question: why Lua doesn't have "overload" to function table.remove so one can remove item by associative index? ...

Open window in JavaScript with HTML inserted

How would I open a new window in JavaScript and insert HTML data instead of just linking to an HTML file? ...

including 1 file among 2 file?

I do apologize for asking this stupid question but I am wondering if you can help me.. i want insert among file $cat1 or $cat2 to in page.php... the code i was create e.g. <? //config.php $cat_all = ($cat2 or $cat1); $cat1 = "cat.php" ; $cat2 = "../back-up/cat.php"; //default anyway if(file_exists($cat1)){ require_once $cat1; }else...

How do I insert an HTML page using PHP?

Hi! I wanted to know, is there any way to insert an HTML page into PHP without using the include function? I do not want to use an external html file, I want to write the html coding directly into the php coding. Thanks for your help! ...

CodeIgniter: Unknown column 'xxx' in 'field list'

Here's my exported BD table: CREATE TABLE `hta_users` ( `id` int(11) NOT NULL auto_increment, `nombre` varchar(100) collate utf8_spanish_ci NOT NULL, `apellidos` varchar(255) collate utf8_spanish_ci NOT NULL, `nif` varchar(10) collate utf8_spanish_ci NOT NULL, `direccion` varchar(255) collate utf8_spanish_ci NOT NULL, `cp` v...

How can I insert array data into MySQL in Perl?

I parse a text file with the script below. How to insert the array data to MySQL table? I already learned Perl MySQL DBI connect method. And I can connect to local MySQL DB successfully. I can create the table with MySQL command line. #!C:\Perl\bin\perl.exe use strict; use warnings; while ( <DATA> ) { my @rocks = split(/\s+/, ...

Zend Framework convert NULL string to actual NULL value for MySql

Somehow when doing an import of data into mysql using a multi-row insert with execute() function, there were many rows added with the string NULL for some columns. How can I convert those NULL strings into MySQL NULL values so that I can check for empty values using is_null() in php when displaying data. How can I avoid this problem? I ...

mysql insert query not responding

i try to insert data to mysql with php code or phpmyadmin but the server waiting for a long and finally prints "not responding error". i can add value to db with logging in mysql using ssh connection. PHP Version 5.1.6 Mysql Client API version 5.0.77 i see error in the log Version: '5.0.77' socket: '/var/lib/mysql/mysql.sock' port: ...