Search Results

Search found 36111 results on 1445 pages for 'mysql update'.

Page 109/1445 | < Previous Page | 105 106 107 108 109 110 111 112 113 114 115 116  | Next Page >

  • incrementing a table column's data by one || mySql

    - by Praveen Prasad
    iam having a table with columns like id || counter if i do something (some event) i want the counter's value(at a particular id) to increase by one , currently iam doing this : //get current value current_value = select counter from myTable where id='someValue' // increase value current_value++ //update table with current value update myTable set counter=current_value where id='someValue'; currently iam running 2 queries for this, please suggest me some way do it in one step.

    Read the article

  • I want to do a sql update loop statement, by using the do--while in php

    - by Jean
    Hello, I want to loop the update statement, but it only loops once. Here is the code I am using: do { mysql_select_db($database_ll, $ll); $query_query= "update table set ex='$71[1]' where field='val'"; $query = mysql_query($query_query, $ll) or die(mysql_error()); $row_domain_all = mysql_fetch_assoc($query); } while ($row_query = mysql_fetch_assoc($query)); Thanks Jean

    Read the article

  • Update all table rows but top N in Mysql

    - by arthurprs
    I was trying to run the following query UPDATE blog_post SET `thumbnail_present`=0, `thumbnail_size`=0, `thumbnail_data`='' WHERE `blog_post` NOT IN ( SELECT `blog_post` FROM blog_post ORDER BY `blog_post` DESC LIMIT 10) But Mysql doesn't allow 'LIMIT' in an 'IN' subquery. I think I can make a select to count the table rows and then make an ordered update limited by 'COUNT - 10', but I was wondering if there is a better way. Thanks in advance.

    Read the article

  • how and when to update a mysql index?

    - by fayer
    im using this sql query to create an index: $query = "CREATE INDEX id_index2 ON countries(geoname_id, name)"; but how do i update the index when new entries are added? should i run a php script with the update query in CRON and run it every night? is this best practice for automated index updating?

    Read the article

  • multiple updation using single mysql query

    - by Ajith
    I need to update multiple rows with different values.Is it possible to do in mysql? ie,some thing like this UPDATE landing_page SET (rotation_slot_begin='0',rotation_slot_end='0.333333333333' where landing_pageid=265),(rotation_slot_begin='0.333333333333',rotation_slot_end='0.666666666667' where landing_pageid=267),(rotation_slot_begin='0.666666666667',rotation_slot_end='1' where landing_pageid=268) but this query is not working.I think something like this.Anybody can help me please

    Read the article

  • difference between cn.execute and rs.update?

    - by every_answer_gets_a_point
    i am connecting to mysql from excel using odbc. the following illustrates how i am updating the rs With rs .AddNew ' create a new record ' add values to each field in the record .Fields("datapath") = dpath .Fields("analysistime") = atime .Fields("reporttime") = rtime .Fields("lastcalib") = lcalib .Fields("analystname") = aname .Fields("reportname") = rname .Fields("batchstate") = "bstate" .Fields("instrument") = "NA" .Update ' stores the new record End With the question is why is there a need to run cn.execute after this? havent i already updated the rs with rs.update?

    Read the article

  • Bulk Update in MYSQl

    - by user351806
    I have a site which has client side and admin side. There is a table called account History. which contains fields like uid | accountBalance | PaymentStatus | Date. Now this table has to be updated every month for all the paid users and the table is bulk. So what is the best way to update the table every month.Do i need to select all the uid's and update.

    Read the article

  • how to define service runlevel order position?

    - by DmitrySemenov
    I setup bind-dlz and need mysql start prior NAMED when system starts here is what I have [root@semenov]# ./test.sh mysql 0:off 1:off 2:on 3:on 4:on 5:on 6:off named 0:off 1:off 2:off 3:on 4:on 5:on 6:off lrwxrwxrwx. 1 root root 15 Apr 15 18:57 /etc/rc3.d/S93mysql -> ../init.d/mysql lrwxrwxrwx. 1 root root 15 Apr 15 18:57 /etc/rc3.d/S90named -> ../init.d/named here is what I have in mysql init script # Comments to support chkconfig on RedHat Linux # chkconfig: 2345 84 16 # description: A very fast and reliable SQL database engine. # Comments to support LSB init script conventions ### BEGIN INIT INFO # Provides: mysql # Required-Start: $local_fs $network $remote_fs # Should-Start: ypbind nscd ldap ntpd xntpd # Required-Stop: $local_fs $network $remote_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: start and stop MySQL # Description: MySQL is a very fast and reliable SQL database engine. ### END INIT INFO so when I remove named from chkconfig and have there just mysql, it starts with order number 84: /etc/rc3.d/S84mysql - ../init.d/mysql but when I add named inside chkconfig it's order changes to 93: /etc/rc3.d/S93mysql - ../init.d/mysql as a result mysql will be starting after named and named will fail (no sql available) any ideas what I'm doing wrong? here is what I have in named init script # chkconfig: 345 90 16 # description: named (BIND) is a Domain Name Server (DNS) \ # that is used to resolve host names to IP addresses. # probe: true ### BEGIN INIT INFO # Provides: $named # Required-Start: $local_fs $network $syslog # Required-Stop: $local_fs $network $syslog # Default-Start:2 3 4 # Default-Stop: 0 1 2 3 4 5 6 # Short-Description: start|stop|status|restart|try-restart|reload|force-reload DNS server # Description: control ISC BIND implementation of DNS server ### END INIT INFO thanks, Dmitry

    Read the article

  • How do I call up values in PHP for user input in forms (radio buttons and selects)

    - by Derek
    Ok so my admin sets to edit a book which was created. I know how to bring in the values that were initially entered via a simple text field like 'bookname'. On the edit book page the book name field stores the currently assigned 'bookname' in the field (which is what I want! :) ) However I have other field types like selects and radio button entries...I'm having trouble calling in the already set value when the book was created. For example, there is a 'booklevel' field, which I have set as radio button entries as; Hard, Normal, and Easy. When the user goes to edit the book, I'm not too sure on how to have the current value drawn up (its stored as text) and the radio button being checked. I.e. 'Normal' is checked if this is what was set when the book was created. So far I have this as the code for the adding book level: <label>Book Level:</label> <label for="booklevel1" class="radio">Hard <input type="radio" name="booklevel" id="booklevel1" value="<?php echo 'Hard'; if (isset($_POST['booklevel'])); ?>"></label> <label for="booklevel2" class="radio">Medium<input type="radio" name="booklevel" id="booklevel2" value="<?php echo 'Normal'; if (isset($_POST['booklevel'])); ?>"></label> <label for="booklevel" class="radio">Low<input type="radio" name="booklevel" id="booklevel3" value="<?php echo 'Easy'; if (isset($_POST['booklevel'])); ?>"></label> This all works fine by the way when the user adds the book... But does anyone know how in my update book form, I can draw the value of what level has been set, and have the box checked?? To draw up the values in the text fields, I'm simply using: <?php echo $row['bookname']?> I also noticed a small issue when I call up the values for my Select options. I have the drop down select field display the currently set user (to read the book!), however, the drop down menu again displays the user in the list available options to select - basically meaning 2 of the same names appear in the list! Is there a way to eliminate the value of the SELECTED option? So far my setup for this is like: <select name="user_id" id="user_id"> <option value="<?php echo $row['user_id']?>" SELECTED><?php echo $row['fullname']?></option> <?php while($row = mysql_fetch_array($result)) { ?> <option value="<?php echo $row['user_id']?>"><?php echo $row['name']?></option> <?php } ?> </select> If anyone can help me I'll be very greatful. Sorry for the incredibly long question!! :)

    Read the article

  • Count Email Address Domains

    - by BRADINO
    A quick tidbit I came up with today to count email addresses in a mysql database table grouping them by domain. So say for example you have a large list of subscribers and you want to see the breakdown of people who use Hotmail, Yahoo, Gmail, etc. SELECT COUNT( SUBSTRING_INDEX( `email` , '@', -1 ) ) AS `count` , SUBSTRING_INDEX( `email` , '@', -1 ) AS `domain` FROM `subscribers` WHERE `email` != '' GROUP BY `domain` ORDER BY `count` DESC This sql statement assumes that the table is called 'subscribers' and the column containing the email addresses is 'email'. Change these two values to match your table name and email address column name. mysql count email mysql count domain mysql split email mysql split domain

    Read the article

  • Two equal items in alternatives list

    - by Red Planet
    I want to have two JDKs. The first one was installed a long time ago to /usr/lib/jvm/java-7-oracle/. I installed the second version and executed following commands to add it to alternatives: red-planet@laptop:~$ sudo update-alternatives --install "/usr/bin/java" "java" "/opt/java_1.6.0_35/bin/java" 2 update-alternatives: using /opt/java_1.6.0_35/bin/java to provide /usr/bin/java (java) in auto mode. red-planet@laptop:~$ sudo update-alternatives --install "/usr/bin/javac" "javac" "/opt/java_1.6.0_35/bin/javac" 2 update-alternatives: using /opt/java_1.6.0_35/bin/javac to provide /usr/bin/javac (javac) in auto mode. red-planet@laptop:~$ sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/opt/java_1.6.0_35/bin/javaws" 2 update-alternatives: using /opt/java_1.6.0_35/bin/javaws to provide /usr/bin/javaws (javaws) in auto mode. And configured: There are 2 choices for the alternative java (providing /usr/bin/java). Selection Path Priority Status ------------------------------------------------------------ * 0 /opt/java_1.6.0_35/bin/java 2 auto mode 1 /opt/java_1.6.0_35/bin/java 2 manual mode 2 /usr/lib/jvm/java-7-oracle/bin/java 1 manual mode Press enter to keep the current choice[*], or type selection number: Why do I have two equal items in the list?

    Read the article

  • Kendo Grid: Foreign Key Dropdown does not update grid cell after update

    - by JookyDFW
    I have a Kendo MVC grid that contains a nullable property (short) that is bound as a foreign key and uses a dropdown list as an editor template. I am also using inline editing. When the property value is null, the dropdown list selected value does not get set into the grid cell after the update button is clicked. This works fine if incell editing is used. I am looking for a workaround that will solve my problem. I am including a stripped down version of my code below Everything works if the nullable value is set to a non-null value. GRID @(Html.Kendo().Grid<AssetViewModel>() .Name("DealAssets") .Columns(c => { c.Bound(x => x.Name); c.ForeignKey(x => x.AssetTypeID, (IEnumerable<SelectListItem>)ViewBag.AssetTypeList, "Value", "Text"); c.ForeignKey(x => x.SeniorityTypeID, seniorityTypeList, "Value", "Text").EditorTemplateName("GridNullableForeignKey"); c.ForeignKey(x => x.RateBaseID, rateBaseList, "Value", "Text").EditorTemplateName("GridNullableForeignKey"); ; c.Command(m => { m.Edit(); m.Destroy(); }); }) .ToolBar(toolbar => toolbar.Create().Text("Add New Asset")) .Editable(x => x.Mode(GridEditMode.InLine)) .DataSource(ds => ds .Ajax() .Model(model => model.Id(request => request.ID)) .Read(read => read.Action("ReadAssets", "Deal", new { id = Model.ID })) .Create(create => create.Action("CreateAsset", "Deal", new { currentDealID = Model.ID })) .Update(update => update.Action("UpdateAsset", "Deal")) .Destroy(destroy => destroy.Action("DeleteAsset", "Deal")) ) ) EDITOR TEMPLATE @model short? @{ var controlName = ViewData.TemplateInfo.GetFullHtmlFieldName(""); } @( Html.Kendo().DropDownListFor(m => m) .Name(controlName) .OptionLabel("- Please select -") .BindTo((SelectList)ViewData[ViewData.TemplateInfo.GetFullHtmlFieldName("") + "_Data"]) ) UPDATE ACTION public ActionResult UpdateAsset([DataSourceRequest] DataSourceRequest request, int ID) { var dealAsset = DataContext.DealAssets.SingleOrDefault(o => o.ID == ID); if (dealAsset != null) { if (TryUpdateModel(dealAsset.Asset, new[] {"Name","AssetTypeID","SeniorityTypeID","RateBaseID" })) { DataContext.SaveChanges(); } } return Json(new[] { new AssetViewModel(dealAsset) }.ToDataSourceResult(request, ModelState), JsonRequestBehavior.AllowGet); }

    Read the article

  • jQuery - growlUI and ASP Update Panel Postback Problem

    - by leaf dev
    I am using the jQuery blockUI plugin's growlUI to display a return status message to the user when returning from an async postback from an update panel. What happens is after returning and displaying the growl notification, any further postbacks seem to be broken and the app just spins. I am using the ScriptManager.RegisterClientScriptBlock method to register the script. and calling the growl UI method in javascript with $.growlUI('Notification', 'Message'); There are no javascript errors being displayed.

    Read the article

  • Remove duplicates and update IDs linked to nonduplicates

    - by colinr23
    I have two tables, tableA and tableB, linked through a locationID. TableA has descriptive survey info with each record from a different time (ie unique), while TableB has purely locational information. However, there are lots of duplicates in TableB, yet each has a unique locationID, which has an entry in TableA. I've found plenty posts about removing duplicates from TableB, but how can I update the locationIDs in TableA so they are linked to the unique locations in TableB once duplicates are removed... Help much appreciated!

    Read the article

  • Update RHEL 5.1 to 5.4

    - by Rayne
    Hi all, I have a server currently running RHEL 5.1, and I would like to upgrade it to RHEL 5.4. The server is not connected to the Internet, so I don't think I can use "yum update". How would I be able to upgrade my server, and is it just a small-scale upgrade, like Windows patches, leaving everything on the server intact, or would it delete everything that was on the server? Thank you. Regards, Rayne

    Read the article

  • Re-indexing table; update with from

    - by David Thorisson
    The query says it all, I can't find out the right syntax without without using a for..next UPDATE Webtree SET Webtree.Sorting=w2.Sorting FROM ( SELECT BranchID, CASE WHEN @Index>=ROW_NUMBER() OVER(ORDER BY Sorting ASC) THEN ROW_NUMBER() OVER(ORDER BY Sorting ASC) ELSE ROW_NUMBER() OVER(ORDER BY Sorting ASC)+1 END AS Sorting FROM Webtree w2 WHERE w2.ParentID=@ParentID ) WHERE Webtree.BranchID=w2.BranchID

    Read the article

  • update app invalid help

    - by Florent
    hi all trying to update my app on itunes connet i get the following : The binary you uploaded was invalid. The executable name, as reported by CFBundleExecutable in the Info.plist file, may not contain any of these characters: \ [ ] { } ( ) . + * please i v searched the web no one encountered this error thanks

    Read the article

  • status update error (null field)

    - by ejah85
    hai guys... i .ve the problem that i cannot be recovered yet... i have one form where admin need to approve or reject the booking request... i've set the b_status field in table usage IN PROCESS default value... i want to update the b_status value BOOKING APPROVED when user click APPROVE button.. otherwise, the b_status will update the value as BOOKING REJECTED when user click on the REJECT button here's is the form code: <?php $db = mysql_connect('localhost','root') or die ("unable to connect"); mysql_select_db('fyp',$db) or die ("able to select"); $sql="SELECT * FROM vehicle WHERE v_status='READY'"; $result = mysql_query($sql) or die ("Query failed!"); ?> <tr><td>&nbsp;</td></tr> <tr> <tr> <td width="200"><font face="Arial" size="2" font color="#000000">Registration Number </font></td> <td><select name="regno"> <option value="" selected>--Registration No--</option> <?php while($row = mysql_fetch_array($result)){?> <option value="<?php echo $row['regno']; ?>"><?php echo $row['regno']; ?></option> <?php } ?> </select></td> <td><font face="Arial" size="2" font color="#000000">Reason</font></td> <td><textarea name="reason" rows="3" cols="50 "value = ""></textarea></td> </tr> <?php $db = mysql_connect('localhost','root') or die ("unable to connect"); mysql_select_db('fyp',$db) or die ("able to select"); $sql="SELECT * FROM driver WHERE d_status='READY'"; $result = mysql_query($sql) or die ("Query failed!"); ?> <tr> <td><font face="Arial" size="2" font color="#000000">Driver</font></td> <td><select id = "d_name" name="d_name"> <option value="" selected>--Driver Name--</option> <?php while($row = mysql_fetch_array($result)){?> <option value="<?php echo $row['d_name']; ?>"><?php echo $row['d_name']; ?></option> <?php } ?> </select></td> </tr> <tr> <?php mysql_close($db); ?> </table> <p></p> <center><input name="APPROVED" type="submit" id="APPROVED" value="APPROVED"> <input name="REJECT" type="submit" id="REJECT" value="REJECT"> </center> </div> </center> and this is the process page code: <?php $db = mysql_connect('localhost','root') or die ("unable to connect"); mysql_select_db('fyp',$db) or die ("able to select"); $bookingno=mysql_real_escape_string($_POST['bookingno']); $username=mysql_real_escape_string($_POST['username']); $name=mysql_real_escape_string($_POST['name']); $department=mysql_real_escape_string($_POST['department']); $g_date=mysql_real_escape_string($_POST['g_date']); $g_time=mysql_real_escape_string($_POST['g_time']); $r_date=mysql_real_escape_string($_POST['r_date']); $r_time=mysql_real_escape_string($_POST['r_time']); $destination=mysql_real_escape_string($_POST['destination']); $pass_num=mysql_real_escape_string($_POST['pass_num']); $trip_purpose=mysql_real_escape_string($_POST['trip_purpose']); $regno=mysql_real_escape_string($_POST['regno']); $d_name=mysql_real_escape_string($_POST['d_name']); $reason=mysql_real_escape_string($_POST['reason']); $b_status=mysql_real_escape_string($_POST['b_status']); $sql = "INSERT INTO `usage` VALUES('$bookingno','$username','$name','$department','$g_date','$g_time','$r_date','$r_time','$destination', '$pass_num','$trip_purpose','$regno','$d_name','$reason','$b_status')"; $query = "INSERT INTO `usage` VALUES b_status ='BOOKING APPROVED'"; $result = @mysql_query($query); $query1 = "UPDATE driver SET d_status ='OUT' WHERE '$d_name'=d_name"; $result1 = @mysql_query($query1); if(isset($_POST['APPROVED'])) { $query2 = "UPDATE `usage` SET b_status ='BOOKING APPROVED' WHERE '$b_status'='IN PROCESS'"; $result2 = @mysql_query($query2); } if (isset($_POST['REJECT'])) { $query3 = "UPDATE `usage` SET b_status ='BOOKING REJECTED' WHERE '$b_status'='IN PROCESS'"; $result3 = @mysql_query($query3); } //$result = mysql_query($sql) or die ("error!"); $result = mysql_query($sql) or trigger_error (mysql_error().' in '.$sql); i.ve the problem on the b_status field.. plz guys... help me ya :-)

    Read the article

  • Prototype's update not working with IE

    - by xain
    Hi, I'm having problems updating a div's content in IE using .update; I also tried with innerHTML with no success. My script works fine with firefox and chrome, but I need to make it work with IE too (neither 7 nor 8 accept the functions). Any hints ? Thanks in advance.

    Read the article

  • Update an Android market app to lower sdk?

    - by Tom Richards
    I have an app on the market that requires sdk 2.0 I want to rewrite and publish it using 1.6 to find a wider audience. The question is: if I update my already published app with an sdk downgrade to 1.6 will it then show up to users with phones at 1.6? I know currently the market search shows my app only to those that have 2.0 phones.

    Read the article

  • SQL Server Update Group by

    - by Gerardo Abdo
    I'm trying to execute this on MS-SQL but returns me an error just at the Group by line update #temp Set Dos=Count(1) From Temp_Table2010 s where Id=s.Total and s.total in (Select Id from #temp) group by s.Total Do anyone knows how can I solve this problem having good performance.

    Read the article

  • SVN tags: How not to update/checkout them?

    - by Boldewyn
    In many projects, I check out the complete repository and have then the standard directory structure: project/ branches/ tags/ trunk/ If I do an svn up project, it's all fine with the branches and trunk folders, but, of course, the tags folder is updated, too, and filled with (mostly) lots of tagged versions that are of no value for my work and only occupy disk space. How can I except the tags folder from an svn update? Especially, how can I do this locally only, that is, without committing that back to the repository, as a solution with the svn:ignore keyword would do?

    Read the article

< Previous Page | 105 106 107 108 109 110 111 112 113 114 115 116  | Next Page >