Re: updating multi row after fetch...include my query script
I'm sorry. the method that I use is post that each value is define by a variable, but the looping proses make it only there only one variable for each row and each column. so..still a dead and for me >>> please refer to the web page view __ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: updating multi row after fetch...include my query script
this is my prosedure 1st. I'm, selecting base on std_nis=111 in STY_RANK_200501 2nd. looping and fetching echoing looping and fetching echoing while ($nline = mysql_fetch_array($result)) { echo $nline["std_value"] echo $nline["std_item"] } - end looping and fetching echoing - 3rd. result of 2nd stage is - result- std_nis std_class std_item std_value 111 1 1 8 -1st row 111 1 2 7 -2nd row 111 1 5 6 -3rd row 111 1 4 9 -4th row end result--- 4th. updating the page(web page) is show like this with new value commnent ---start web page view --- Update Student Value for Student NIS 111 in Class 1 Study(define as std_item) Value(define as std_value) 1 7 <---this new value 2 4 <---this new value 5 9 <---this new value 4 10 <---this new value Submit Reset ---end web page view so the new value will update the old value of each study item using ---updating script $query = "update STY_REPORT_200501 set std_value='" . $nenilai . "', std_nis='" . $nenis . "', std_item='" . $neitem . "', std_entusr='" . $neentusr . "' where std_item=".$neitem ; - end updating script--- and that the complate way I'm doing it, but when user click the submit result is like this ---after submiting- std_nis std_class std_item std_value 111 1 1 8 -1st row 111 1 1 8 -2nd row 111 1 1 8 --3rd row 111 1 1 8 -4th row - end submitting -- so how I had to doit so each row will update base on it std_item, not make it all as std_item=1 and value is 8 ? __ Yahoo! Mail Mobile Take Yahoo! Mail with you! Check email on your mobile phone. http://mobile.yahoo.com/learn/mail -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: updating multi row after fetch...include my query script
my looping in my first script, from table STY_REPORT_200501 I'm including the value -1st query (looping)- $query = "select a.*, b.sty_descr as styname from STY_REPORT_200501 a left join STY_ITEM b on a.std_item=b.sty_code where a.std_nis=111 -end looping the result is -result-- std_nis std_class std_item std_value 111 1 1 8 -1st row 111 1 2 7 -2nd row 111 1 5 6 -3rd row 111 1 4 9 -4th row end result--- __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: updating multi row after fetch...include my query script
I'm sorry if I didn't make it so clear, here is what I'm doing, ---script start here--- $query = "select a.*, b.sty_descr as styname from STY_REPORT_200501 a left join STY_ITEM b on a.std_item=b.sty_code where a.std_nis=" . $stid; $result = mysql_query($query) or die("Query " . $_SERVER["PHP_SELF"] . " : " . $query . " failed"); $ccount = mysql_num_rows($result); while ($nline = mysql_fetch_array($result)) { echo $nline["std_item"]; echo $nline["std_value"]; end first script-- this script have output is like this result STY REPORT std_nis std_class std_item std_value 111 1 1 8 -1st row 111 1 2 7 -2nd row 111 1 5 6 -3rdt row 111 1 4 9 -4th row 222 3 1 6 222 3 2 5 222 3 3 6 end result and the result POST to the second script ---second script $_SESSION["action"]=="EDITNilai"){ $query = "update STY_REPORT_200501 set std_value='" . $nenilai . "', std_nis='" . $nenis . "', std_item='" . $neitem . "', std_entusr='" . $neentusr . "' where std_item=".$neitem ; ---end second script after executed the second script the result is like this ---2nd result-- std_nis std_class std_item std_value 111 1 1 8 -1st row 111 1 1 8 -2nd row 111 1 1 8 --3rd row 111 1 1 8 -4th row 222 3 1 8 222 3 2 5 222 3 3 6 ---end 2nd result--- the update based on std_nis make all std_item become same, how to update the multi row with it content without change other row in same std_nis in one query ? I'm hoping the update chane in std_value only --hoping result std_nis std_class std_item std_value 111 1 1 6 -1st row, old=8 111 1 2 5 -2nd row, old=7 111 1 5 2 -3rdt row, old=6 111 1 4 7 -4th row, old=9 222 3 1 6 222 3 2 5 222 3 3 6 end result I hope that clear enough, is there any way to make it work ? __ Do you Yahoo!? Make Yahoo! your home page http://www.yahoo.com/r/hs -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: updating multi row after fetch
STY REPORT std_nis std_class std_item std_value 111 1 1 8 111 1 2 7 111 1 5 6 111 1 4 9 222 3 1 6 222 3 2 5 222 3 3 6 my fetching result is like that, how do I update those rows in one single query __ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: updating multi row after fetch
Yes, I want to update all row in one query --- Michael Stassen <[EMAIL PROTECTED]> wrote: > Aji Andri wrote: > > > my table properties > > > > `STY_REPORT_200501` ( > > `std_nis` int(10) NOT NULL default '0', > > `std_class` varchar(10) default NULL, > > `std_item` int(2) default NULL, > > `std_value` float default NULL, > > `std_letter` char(2) default NULL, > > `std_entusr` varchar(10) NOT NULL default '', > > KEY `std_class` (`std_class`), > > KEY `std_item` (`std_item`), > > KEY `std_value` (`std_value`), > > KEY `std_letter` (`std_letter`), > > KEY `std_entusr` (`std_entusr`) > > ) TYPE=MyISAM; > > > > > > I'm doing this query > > SELECT * > > FROM `STY_REPORT_200501` > > WHERE 1 LIMIT 0 , 30 > > > > when I how do I make multi row update based on my > > fetch result ? > > We need more information. Do you want to update > those rows, or use the > data in those rows to update another table? > > Michael > __ Do you Yahoo!? Make Yahoo! your home page http://www.yahoo.com/r/hs -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
updating multi row after fetch
my table properties `STY_REPORT_200501` ( `std_nis` int(10) NOT NULL default '0', `std_class` varchar(10) default NULL, `std_item` int(2) default NULL, `std_value` float default NULL, `std_letter` char(2) default NULL, `std_entusr` varchar(10) NOT NULL default '', KEY `std_class` (`std_class`), KEY `std_item` (`std_item`), KEY `std_value` (`std_value`), KEY `std_letter` (`std_letter`), KEY `std_entusr` (`std_entusr`) ) TYPE=MyISAM; I'm doing this query SELECT * FROM `STY_REPORT_200501` WHERE 1 LIMIT 0 , 30 when I how do I make multi row update based on my fetch result ? __ Yahoo! Mail Mobile Take Yahoo! Mail with you! Check email on your mobile phone. http://mobile.yahoo.com/learn/mail -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Newbie :create table multi, index
hi seniors, I'm trying to create a table, here my table properties, create table user ( UserID int primary, Password varchar (20), User_stats int multi ); i'm still confuse in User_stats properti's that is multi, what really use 'multi' is ? and what the conection between primary key and index Thx before the guide, Aji __ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
newbie question create table
hi seniors, I'm trying to create a table, here my table properties, create table user ( UserID int primary, Password varchar (20), User_stats int multi ); i'm still confuse in User_stats properti's that is multi, what really use 'multi' is ? Thx before the guide, Aji __ Yahoo! Messenger Show us what our next emoticon should look like. Join the fun. http://www.advision.webevents.yahoo.com/emoticontest -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
query problem in num_row
here a syntax $query=&$conn->Execute("select * from itemlocation where id limit 1 - 50"); $result=mysql_query($query); $num_result=mysql_num_rows($result); and error message are syntax error in $num_result=mysql_num_rows($result); object unknown can someone please give a direction all I want to do is comparing data in itemlocation with a value and if value in item location is smaller then the value I make then it will appear in a message Aji __ Do you Yahoo!? The all-new My Yahoo! - Get yours free! http://my.yahoo.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: adding automatic alert
--- Roger Baklund <[EMAIL PROTECTED]> wrote: > Aji Andri wrote: > > Hi all, > > I'm make an inventory goods database, in one of my > > table I need to make an automatic alert when my > stock > > reach it's limit (say for tires it's limit is 4), > can > > I make an automatic alert for it so when it reach > it > > limit I can have an alert may be a beep or a dialog box ? > > This is a typical task for the programming > language/tool you are using > to create your application. What you ask may look a > bit like a task for > a trigger, but triggers work serverside, and I > assume you want the beep > on the client. I really think you would be better of > just using a simple > script, running every 30 minutes or so. Something > like this (meta code): > > cnt = select stock from goods where > goodstype='tires' > if (cnt < 5): > beep() > send_email('[EMAIL PROTECTED]','Out of tires!') > > (This script will of course keep beeping/sending > emails every 30 minutes > until you stop the script or increase the registered > stock above the > limit... ) > > -- > Roger (sorry Roger for mis-sending, I think it was send to list, :-) ) __ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
adding automatic alert
Hi all, I'm make an inventory goods database, in one of my table I need to make an automatic alert when my stock reach it's limit (say for tires it's limit is 4), can I make an automatic alert for it so when it reach it limit I can have an alert may be a beep ? Thanks __ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]