Hi all I have a script to update the value from datagridview to database I do use a button insert ToolStripButton but not working hope people to help thank ! Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load conn = New SqlConnection("") conn.Open() Dim query As [String] = "SELECT * FROM dtaEmployees" da = New SqlDataAdapter(query, conn) Dim cb As New SqlCommandBuilder(da) dt = New DataTable() da.Fill(dt) C1FlexGrid1.DataSource = dt conn.Close() End Sub Private Sub ToolStrip1_ItemClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles ToolStrip1.ItemClicked Select Case e.ClickedItem.Name Case "ToolStripButton1" '---> button insert da.Update(dt) End Select …

Member Avatar
Member Avatar
+0 forum 7

if(isset($_GET['Id'])){ $Id=$_GET['Id']; $query = mysql_query("SELECT * FROM page WHERE ID='$Id'"); $row = mysql_fetch_array($query); $PageId=$row['PageId']; $MenuName=$row['MenuName']; $ParentMenuId=$row['ParentMenuId']; $LinkWidth=$row['LinkWidth']; $OtherUrl=$row['OtherUrl']; $Status1=$row['Status']; $OnMainMenu=$row['OnMainMenu']; $FooterMenu=$row['FooterMenu']; } ?> <form style="width:100%" action="" method="post" id="form1"> <table class="viewjob" align="center" > <tr class="tableheader"> <td align="center" colspan="4"> Update </td> </tr> <tr class="tablerow"> <td>Page Id</td> <td><select name='PageId' class="select"> <option value='0' >select any page</option> <?php $sql10 = "SELECT Id,Title FROM abc"; $val=$row['PageId']?:''; $rs = mysql_query($sql10) or die(mysql_error()); while($row = mysql_fetch_array($rs)){ $selected = ($val == $row['Id'] ? 'selected="selected"' : ''); echo '<option value ="' . $row['Id'] . '" '. $selected .'>' . $row['Title'] . '</option>'; } mysql_free_result($rs); ?> </select> </td> i am insert …

Member Avatar
Member Avatar
+0 forum 6

Hello, I found this script and have used it for my login system. http://www.wikihow.com/Discussion:Create-a-Secure-Login-Script-in-PHP-and-MySQL I have changed some variables but none the less its the same. I am trying to create a reset password script here is what i tried so far: function resetPassword(){ //Main Info $id = $_POST['id']; $email = $_POST['email']; $pass= $_POST['password']; //salt and pass info $random_salt = hash('sha512', uniqid(mt_rand(1, mt_getrandmax()), true)); $password = hash('sha512', $pass.$random_salt); //Run the Query $update_stmt = $mysqli->prepare("UPDATE members SET password='$password' AND salt='$random_salt' WHERE id = ?"); $update_stmt->bind_param('s', $id); if($update_stmt->execute()) { if(login($email, $password, $mysqli) == true) { header('Location: ../signin.php?pass=1'); }else { header('Location: ../passreset.php?error=1'); } …

Member Avatar
Member Avatar
+0 forum 3

I have the following code,I have created a form for attemting a scheme of changing the password for the user. i have hashed my password and stored it in the database. Now in the database it looks like, "980a3a0b40df9a1". Whenever i enter the changed password in the form it throws an error of in-correction. I have to enter the complete hashed password for it. I want to know how can i get the unhashed passwords for form? <?php session_start(); include_once("../includes/connection.php"); $msg = ''; //posting variables! if(isset($_POST['old_password']) && isset($_POST['n_password']) && isset($_POST['new_password'])){ $old_pass = mysql_real_escape_string($_POST['old_password']); $password = mysql_real_escape_string($_POST['n_password']); $new_pass = mysql_real_escape_string($_POST['new_password']); //defining …

Member Avatar
Member Avatar
+0 forum 2

how to edit in the post in php? i m using update query but no working? can anyone suggest me any idea and please give me suitable example

Member Avatar
Member Avatar
+0 forum 3

Hello I faced this type of Error in codeigniter. Can you suggest me any solution... *ERROR : You must use the "set" method to update an entry.* In Model Code is.. $this->db->where('user_id',$user_current_id); $this->db->update('admin_resume_expertise',$data); Thank YOu

Member Avatar
Member Avatar
+0 forum 2

im working on my login script and whilst testing it, it seems that the code doesnt recognise the details stored within a database im entering a valid username and password in the login form but it is not processing it somehow the system thinks its wrong. I cant find any more errors i am running an error report function and nothing appears i cant seem to figure out where the problem is <?php error_reporting(E_ALL); include_once("conninfo2.php"); if(isset($_POST['username']) && trim($_POST['username']) != ""){ $username = strip_tags($_POST['username']); $password = $_POST['password']; $hmac = hash_hmac('sha512', $password, file_get_contents('textfiles/key.txt')); $stmt1 = $db->prepare("SELECT usersid, password FROM login WHERE username=:username …

Member Avatar
Member Avatar
+0 forum 16

This is my main page where the user can choose a category from a drop down. I need that category selection to update my session variable so I can then send that variable to another php page execute a query and return the result in my div because I do not want the entire page reloading everything the users hits submit. Main issue: I cannot figure out how to reset/set the session variable when a user clicks submit then push that session variable to the next page for processing and return that page results back into my div. Mainpage.php <?php …

Member Avatar
Member Avatar
+0 forum 7

below is the code which select value from the database and increase it by 2 and update the database with the new value. how do I lock or prevent multiple read and update at the same time? please help Dim query2 As String = "select * from " + usern + " where id=@selcand " 'select value from database Dim myCommand2 As New SqlCommand(query2, con1) myCommand2.Parameters.AddWithValue("@selcand", tbxcand.text) myReader2 = myCommand2.ExecuteReader() While myReader2.Read() Session("tov") = myReader2(5) End While con1.Close() Session("tov") += 2 'increase value by 2 con1.Open() 'update database with the new value Dim query As String = "UPDATE " + …

Member Avatar
+0 forum 0

Hi I need to delete words before a set of words in a field. eg delete the words before the word price in that field. I already have a query to replace a certain word but cant see how adapt it to do what I require update TABLE set `field` = replace(`field`,'price',''); can somebody help please? Thanks in advance

Member Avatar
Member Avatar
+0 forum 1

Hello Sometimes I get a duplicate key which I want to ignore or discard. This is a example and has nothing to do with the actual query. I simple want to state columns/values insert into table(Time_Stamp,Time_Stamp_ms,p1) values (time,timems,'1') Where the first two are my PK. I see that insert into table(Time_Stamp,Time_Stamp_ms,p1) values (time,timems,'1') on duplicate key exists but it asks me for a UPDATE. How do I update on "Time_Stamp" and "Time_Stamp_ms"? Im sorry for not explaining correctly my problem.

Member Avatar
Member Avatar
+0 forum 2

Hey there. I'm building a project in PHP/MySQL and it is a sort of [FaceMash](http://en.wikipedia.org/wiki/History_of_Facebook#Facemash) project. I am able to call the images (with image name and points) from the database. I have managed to use the MySQL Update query in order to increase the points that each image gets when clicked but it just applies this to every image in the database. I cannot work out how to use the WHERE part of the update query that gives the point **to that specific image that was clicked**. I have it set up as follows: rate.php (the main page) *Click …

Member Avatar
Member Avatar
+0 forum 5

hi everyone, i want to store an image in database not by inserting but by updating (by using UPDATE query) and hers my code... everything else is updated successfully but its not storing image..please help me to solve the problem.. im using medium blob data type to store image this is my update-profile.php <form id="form" method="post" action="update-profile-action.php" enctype="multipart/form-data"> <label for="Fname">First Name:</label> <input type="text" id="Fname" class="text" value="<?php echo $firstname; ?>" name="Fname" /> <br /><br /> <label for="Lname">Last Name:</label> <input type="text" id="Lname" class="text" value="<?php echo $lastname; ?>" name="Lname" /><br /> <br /> <?php if ($_SESSION["type"]=="T") { ?> <label>Profile Image:</label> <input type="file" name="image" …

Member Avatar
Member Avatar
+0 forum 3

i have four columns in a gridview .Every field is a template field with checkboxes.I have a button. when i check the check boxes and store it in database the checkbox value is storing. but after clicking the button the checkboxes unchecked. how to make the checkboxes checked . public partial class _Default : System.Web.UI.Page { DataUtility dut = new DataUtility(); SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["Con"]); protected void Page_Load(object sender, EventArgs e) { Label5.Text = (string)Session["Role_Name"]; if (!IsPostBack) { populateGridview(); } } public void populateGridview() { if (Session["Role_Name"] != null && !string.IsNullOrEmpty(Session["Role_Name"].ToString())) { string qry = "select ID,Pages,[Add],[View],Edit,[Delete] from Role1 …

Member Avatar
Member Avatar
+0 forum 1

Good afternoon, I'm trying to formulate what should be a simple query that will create a result set of ALL records from a table that have a date that is in the previous month... Basically something like this one that I use that gets any records prior to the current week, only for the month... UPDATE trans_earnings SET status = 'P' WHERE status = 'E' AND YEARWEEK(earned_date, 0) < YEARWEEK(NOW(), 0) AND abbrev = 'ABC' This would be used in a script that is run once each month, so it would basically effect all records from the previous month. Any …

Member Avatar
Member Avatar
+0 forum 1

Hi, I am new to VB.NET and am working on what is pretty much my first app. The app is based on a sql data source (created within Visual Studio) and basically is intended to show who is on-call when the app is loaded. So, i have some test data, and my form currently shows all the current times in the different support areas that we have and that all seems to be working fine. The second part runs a function which creates labels at runtime based on how many teams are set up and populates the label.text property with …

Member Avatar
Member Avatar
+0 forum 51

<?php $host = "localhost"; $user = "root"; $pass = ""; $databaseName = "foresight"; $tableName = "userinfo"; $con = mysql_connect($host,$user,$pass); $dbs = mysql_select_db($databaseName, $con); $result = mysql_query("SELECT * FROM $tableName where flag != 1"); //query $email = mysql_fetch_row($result); //fetch result mysql_close( $con ); ?> <?php $connection = mysql_connect("192.232.240.245","root","causealmedus-1608"); if (!$connection) { die('Could not connect: ' . mysql_error()); } mysql_select_db("foresight", $connection); while($email) { $sql="INSERT INTO userinfo ('email') VALUES ('" . $email['email'] . "')"; if (!mysql_query($sql,$connection)) { die('Error: ' . mysql_error()); } echo $email; //and using connection of localhost you have to update same record with status 1 at localhost. } mysql_close($con) ?> …

Member Avatar
Member Avatar
+0 forum 1

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.Linq.Mapping; public partial class Default3 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } public void showgridview() { DataClassesDataContext dc = new DataClassesDataContext(); var q = from a in dc.GetTable<bio>() select a; GridView1.DataSource = q; //GridView1.DataSource = dc.GetTable<bio>(); GridView1.DataBind(); } public void whereQuery() { DataClassesDataContext dc = new DataClassesDataContext(); var q = from a in dc.GetTable<bio>() where a.name == TextBox3.Text select a; GridView1.DataSource = q; GridView1.DataBind(); } protected void Button2_Click(object sender, EventArgs e) { whereQuery(); } protected void Button1_Click(object sender, EventArgs e) { showgridview(); } …

Member Avatar
Member Avatar
+0 forum 1

I want to perform an UPDATE query but i'm getting this error: ![errorHAVING](/attachments/fetch/L2ltYWdlcy9hdHRhY2htZW50cy8zL2Vycm9ySEFWSU5HLkpQRw%3D%3D/500 "errorHAVING") This is my Sub in vb.net: Public Sub changeStatus() Dim Sqlstr As String Dim connectionString As String = "server=xxxx;uid=xxxx;pwd=xxxx;database=xxxx" Dim strtTime As String Dim endTime As String strtTime = DateTime.Today.ToString("yyyy/MM/dd") & " " & "06:15:00" endTime = DateTime.Today.ToString("yyyy/MM/dd") & " " & "18:15:00" Sqlstr = " UPDATE dbo.VAC_LineStatus " Sqlstr = " SET SET Status = @Status " Sqlstr = " WHERE (Line IN " Sqlstr = " (SELECT VAC_JSINFO.LINE " Sqlstr = " FROM dbo.VAC_LineStatus INNER JOIN " Sqlstr = " VAC_JSINFO ON dbo.VAC_LineStatus.Line = …

Member Avatar
Member Avatar
+0 forum 3

The End.