Jump to content

Search the Community

Showing results for tags 'insert'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Calendars

  • Community Calendar

Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 11 results

  1. Unwanted Row Entry Duplication

    QUESTION ONE: How does one suppress duplicate row entries? QUESTION TWO: In the following case what is causing them to occur? BACKGROUND: I created several tables only to discover that they were not as I wanted them. AFter truncateng each, I dropped what I believed to be poorly structured columns, rearranged some, and added still others. When I tested the result, everything worked great except for one problem -- a single table entry reuslted in duplicate rows. THE TABLE STRUCTURE CREATE TABLE 'table_name' (obs` int(5) NOT NULL AUTO_INCREMENT . . . PRIMARY KEY (`obs`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 A SAMPLE SQL STATEMENT INSERT INTO rss2_podcast_itunes (podcast_no_itunes, itunes_category1, itunes_category2, itunes_category3, itunes_complete, itunes_new_feed_url, itunes_name, itunes_email, itunes_duration, itunes_order, itunes_author, itunes_block, itunes_image, itunes_explicit, itunes_summary) VALUES ('54', 'education', 'language', 'English', '', '', 'Roddy A. Stegemann', 'kiusau@me.com', '00:01:01', '', 'Roddy A. Stegemann', '', 'http://www.grammarcaptive.com/_images/captive.png', '', 'Test') Please note the following: No value is entered for the obs field/column. The auto increment advances one for each row entered. Below each successfully loaded row entry appears another row identical in every way but one -- the appearance of an incremental advance in the value of the obs field. Please advise. Roddy
  2. updating a user row, need help.

    hello programmers am having an update issue and i dont know how to go about it am gonna try n explain it the way i can plz bear with me. i have a table called bids and two important column called bidder and tagged when (bidder 5) has no one to tag he simple drops a bid and when another bidder comes along(bidder 3) he tags (bidder 5) i want bidder 5 row to update showing (bidder 3)in his row. for example bidder 5 place bid it looks like this bidder tagged 5 0 no one to tag so it shows zero i want if bidder 5 get tagged by bidder 3 it update showing the person that tag bidder 5 and it will look like this bidder tagged 5 3 from the image i attached u can simply understand what am saying. looking forward to ur replies thanks code i am using to fill the form is below // tag someone $query = "SELECT b.*, u.nick FROM " . $DBPrefix . "bids b LEFT JOIN " . $DBPrefix . "users u ON (u.id = b.bidder) WHERE b.bidder NOT IN ('b.tagged') and b.tagged IN ('b.bidder') and b.auction = :auc_id "; $params = array(); $params[] = array(':auc_id', $id, 'int'); $db->query($query, $params); $i = 0; while ($row = $db->fetch()) { $template->assign_block_vars('tag_bidder', array( 'ID' => $row['bidder'], 'NAME' => $row['nick'], 'TAGGED' => $row['tagged'] )); $i++; }
  3. Cart Order to History Order table

    Dear all, i have been working in my college project and i reached a point were i can't get my cart orders into Order history, as it's not working and keep giving me the following error page, Error : INSERT INTO `cib4003_h00233671_at`.`orderhistory`(`order_id`, `Product_ID`, `Product_Name`, `client_ID`, `quantity`) VALUES ('', '', '', '2', ''); Duplicate entry '0' for key 'PRIMARY' ^ i checked the databse and all values are 0 except the Client_ID... thats why i am getting Duplicate entry, however, i tried to fix the problem for the past few hours and i can't find the issue, here my cart page code and here my history php where i do the insert part
  4. which query should be used when you have this INSERT INTO `$variable` (col1, col2) VALUES ..... The question is regarding $variable. is it " ", ' ' ,` ` . ?
  5. Error #1136 Message

    Hi Guys, am new to PHP and just got stuck with this error message: Column count doesn't match value count at row 1. The code is this below: $query = "INSERT INTO members(email, name, gender, dob, profile, password, group_ID) SELECT operations.group_ID FROM operations JOIN members ON operations.group_ID = members.group_ID" ; $result = $db->query($query); Am trying to insert data into a table called members, and needs to get the group_ID from another table called operations. Not so sure what is wrong with the code; will appreciate help from anyone. Cheers.
  6. another Problem with insertting

    i want to insert student result that he calculate some equation and send it to his cell in users database my problem is i cant send the result of some student to his own cell in the users table when i try to do it ,,its always (result) go to the first user that i logged in with ,, i think the issues with my SESSION can any 1 help please ??? my index.php code was <html><head><title>Home Work Page</title></head><body><form action="login.php?login=yes" method="POST"><table border=1> <tr> <td> username : <input type="text" name="username"/></td><br /><td> password :<input type="password" name="password"/> </td> </tr> </table><input type="submit" name="resultbtn" value='login'/></form></body></html> and my login.php code is <?phperror_reporting(0);$username = $_POST['username'];$password= $_POST['password'];$login = $_GET['login'];setcookie("username","$username",time()+15);if($login=='yes') {$con = mysql_connect("localhost","root","");mysql_select_db("members");$get = mysql_query("SELECT count(id) FROM users WHERE username='$username' and password='$password' ");$resultt = mysql_result($get,0);if($resultt !=1){ echo "error with login"; }else { $_SESSION['username'] = $username; $sql = "SELECT * FROM users WHERE username='$username' "; $myval = mysql_query($sql,$con);echo "welcome back " . $_COOKIE['username'];echo"<br/><br/><br/><br/><html dir='rtl'><meta charset ='Windows-1256'></html><table> <tr> <th> </th></tr>";if ($val = mysql_fetch_array($myval)) {echo "<tr>";echo " <td>" . "the question : calculate the triangle area if H = " . "</td>";echo " <td> <input type='text' value= $val[val1] disabled='disabled' size=5/> ". "</td>";echo " <td>and L = <input type='text' value= $val[val2] disabled='disabled' size=5/> ". "</td>";echo "</tr>"; }echo "</table>";}}echo"<form action='result.php' method='POST'><br/><br/><br/><br/><table><tr><td> Hello student the result will be : <input type='text' name='add' ></td><td><input type='submit' name='submit' value='send results'></td></tr></table></form>";?> and the result.php (the page with my problems) code is <?phperror_reporting(0);$val3 = $_POST["add"];//connectmysql_connect("localhost", "root", "");mysql_select_db("members");//insert$insert_query = mysql_query("UPDATE users SET results='$val3' WHERE username ='$_SESSION[username]' ");$query = mysqli_query($insert_query) or die(mysqli_error());//check whether the data insertion was successfulif(!$insert_query)echo "<p>Sorry! Something went wrong.</p>";elseecho "<p>Thanks! Your Results has been Sent.</p>"; my logout.php code is <?phpsession_start();unset($_SESSION['username']);session_destroy();header ("location: index.php");?> my table looks like
  7. help: insert data from a table

    please help me inserting data to mysql database table from a html table. like <table> <tr> <td>name</td> <td>Gender</td> <td>age</td> <td>school</td> </tr> <tr> <td>John</td> <td>Male</td> <td>21</td> <td>Oxford</td> </tr> <tr> <td>Juliya</td> <td>Female</td> <td>25</td> <td>Oxford</td> </tr><!- bla! bla! bla! --></table>SUBMIT I want to send all the rows' data at once to a table. Please guide how could it be done!
  8. Stored Procedure

    CREATE PROCEDURE
  9. varchar into nvarchar

    I am wanting to insert fields from a table (data types are varchar(50) into another empty table (who's data type is nvarchar(50)). I believe I have created the correct query to achieve this but received an error message when executing "Msg 8152, Level 16, State 4, Line 1 String or binary data would be truncated" Would these two data types be the cause of this? I'm using some other data types (int, bigint) that could possibly be the issue but these are the main ones used to I wanted to see about them first.
  10. Insert data using c language

    How to insert data in the last row but not in the first row using C language.Do sqlite have function that control the row of the insert?I want the sequential row numbers from insert query.Thanks.
  11. ASP.NET - Insert Data

    Hi. Quite new to ASP.NET, doing a web design course. I have built a website, and am just building the order part - this is for an assignment. This is the code I have so far: @{ Layout="~/Shared/accountArea.cshtml"; Page.Title="New Order | Sarnies For All"; if (!WebSecurity.IsAuthenticated) { Response.Redirect("~/"); } var db = Database.Open("sarniesForAllCurrent");} <h1>New Order</h1> <p>Here you can create your own sandwich. First of all select your desired bread type from the drop down box below. Then move on to select the filling which you would like in your sandwich/wrap/baguette.</p> <p>All the products shown on this page are in stock, there will be no ringing you informing you that we can't make your order! If you have any issues with this, or have a special request don't hesitate to give us a call or use the Contact Us page.</p> <form id="newOrder" method="post" action="mailto:kevin.upshaw@live.co.uk"> <h2>Choose Bread Type</h2> <fieldset class="newOrder"> <div class="panel"> @{ var extractAvailableBread = "SELECT breadId, breadDescription, price, imgReference FROM [bread] WHERE UPPER(available) = 'YES' ORDER BY breadId "; } @foreach (var row in db.Query(extractAvailableBread)) { <div class="productArea"> <div class="productTitleArea"> <p class="productTitle">@row.breadDescription</p> </div> <div class="productImageArea"> <img class="productImage" src="@row.imgReference" alt="| Sarnies For All" /> </div> <div class="productPriceArea"> <p class="productPrice">£@row.price</p> </div> <div class="productSelectionArea"> <p class="productSelection"><input type="radio" name="breadSelection" value="@row.breadDescription" /></p> </div> </div> } </div> <p class="flip">Open/Close Available Bread Selection</p> </fieldset> <h2 class="clearBreak">Choose Your Filling</h2> <fieldset class="newOrder"> <div class="panel1"> @{ var extractAvailableFilling = "SELECT fillingDescription, price, imgReference FROM [filling] WHERE UPPER(available) = 'YES' ORDER BY filling "; } @foreach (var row in db.Query(extractAvailableFilling)) { <div class="productArea"> <div class="productTitleArea"> <p class="productTitle">@row.fillingDescription</p> </div> <div class="productImageArea"> <img class="productImage" src="@row.imgReference" alt="| Sarnies For All" /> </div> <div class="productPriceArea"> <p class="productPrice">£@row.price</p> </div> <div class="productSelectionArea"> <p class="productSelection"><input type="radio" name="fillingDescription" value="@row.fillingDescription" /></p> </div> </div> } </div> <p class="flip1">Open/Close Available Fillings Selection</p> </fieldset> <h2>Choose Salad Type</h2> <fieldset class="newOrder"> <div class="panel2"> @{ var extractAvailableSalad = "SELECT saladDescription, price, imgReference FROM [salad] WHERE UPPER(available) = 'YES' ORDER BY saladId "; } @foreach (var row in db.Query(extractAvailableSalad)) { <div class="productArea"> <div class="productTitleArea"> <p class="productTitle">@row.saladDescription</p> </div> <div class="productImageArea"> <img class="productImage" src="@row.imgReference" alt="| Sarnies For All" /> </div> <div class="productPriceArea"> <p class="productPrice">£@row.price</p> </div> <div class="productSelectionArea"> <p class="productSelection"><input type="radio" name="saladDescription" value="@row.saladDescription" /></p> </div> </div> } </div> <p class="flip2">Open/Close Available Salad Selection</p> </fieldset> <h2 class="clearBreak">Confirmation</h2> <p>Please confirm your selections and then hit the "Create" order button below. Your order will then be submitted and you will be redirected to your account.</p> <input type="submit" id="submit" name="submit" value="Create Order" /> <input type="reset" id="resetOrderForm" name="resetOrderForm" value="Reset Order Form" /> </form> All the code I have works absolutely fine so far. It queries the "bread" table in the database for "available" bread. The idea I had now is that for each section the user would select one option (hence the use of radio buttons) and when the user selects the option in each section the "*Id" for the option selected is stored in a variable - in which I can then do a SQL INSERT INTO - into the order database. However everything I try code wise has failed on me and wondering if anyone has any suggestions/advice?
×