-
Posts
216 -
Joined
-
Last visited
Everything posted by Yohanne
-
Hi coders, i need an advice for having this situation and i don't know if you are already encounter this scenario. please visit this site : www.silvertec.com and please click first ABOUT US and 2nd is PRODUCT and after cleking the product you found out the error. a link that out of a system. and i really no idea where it comes. and when i check the code so far, there is nothing wrong with code. please advice what to do and to ignore that link. so far my code below for link. <script> function about_us() { window.location.assign("aboutus.php") } function product_s() { window.location.assign("products.php") } function comming_soon() { window.location.assign("comingsoon.php") } function support_us() { window.location.assign("support.php") } function contact_us() { window.location.assign("contactus.php") } </script> <table border="0" cellspacing="0" cellpadding="0" width="100%"> <tr> <td width="191"><a href="index.php"><img src="<?=$bannerpath.$row_logo['image_1']?>" height="31" border="0" title="silvertec logo" /></a></td> <td valign="bottom"> <table border="0" cellspacing="0" cellpadding="0" width="812" height="39" background="images/menu.png"> <tr> <td width="36" align="center"><a href="index.php"><img src="images/home2.png" width="14" height="14" border="0" /></a></td> <td width="154" class="menu_btn" onclick="about_us()">About Us</td> <td width="154" class="menu_btn" onclick="product_s()">Products</td> <td width="154" class="menu_btn" onclick="comming_soon()">Online shop</td> <td width="154" class="menu_btn" onclick="support_us()">Support</td> <td width="154" class="menu_btn" onclick="contact_us()">Contact Us</td> </tr> </table> </td> </tr> </table>
-
Do not display Radio Button if its value is in DataBase
Yohanne replied to NebuJohn's topic in PHP Coding Help
it is working or not? and i guest if statement is enought to work you asking. -
Do not display Radio Button if its value is in DataBase
Yohanne replied to NebuJohn's topic in PHP Coding Help
@Nibujohn: may i saw your solution? -
yes, i know what im doing and i know why i need to update the following field. i im just asking now for the right syntax code for multiple update.
-
im not already using ignore. just simple above. and my problem now is' to update and i can merge data through to add id in mysql $odbc = "UPDATE Audit SET temp = '$_POST[temp_f]' WHERE audit_id".implode(',', $AR);
-
please help with this, insert is working good while update in access in not. i will appreciate any help Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'audit_id'780215,'780216,'780217,'780218,'780219,'780220,'780221,'780222,'780223,'780224,'780225,'780226,'780227,'780228,'780229,'780230,'780232,'780233,'780231,'780234,'780235,'780236,'780237,'780238,'780239,'780240,'780241,'780242,'780246,'780245,'780244,'7'., SQL state 37000 in SQLExecDirect in C:\xampp\htdocs\protonSystem\store\view\save.php on line 37 foreach($_POST['audate_id'] as $row=>$name) { $user_name = mysql_real_escape_string($_POST['user_name'][$row]); $audit_id = mysql_real_escape_string($_POST['audate_id'][$row]); $stock_id = mysql_real_escape_string($_POST['sid'][$row]); $tran_type = mysql_real_escape_string($_POST['type'][$row]); $movement = mysql_real_escape_string($_POST['movement'][$row]); $audit_date = mysql_real_escape_string($_POST['a_date'][$row]); $array[] = "('$user_name', '$audit_id', '$stock_id', '$tran_type', '$movement', '$audit_date')"; } $sql ='INSERT INTO pro_data(username, audit_id, stock_id, transaction_type, movement, audit_date) VALUES '.implode(',', $array); $result = mysql_query($sql)or die("$sql" .mysql_error()); if($result) { $conn=odbc_connect('db2','',''); if (!$conn) { exit("Connection Failed: " . $conn); } foreach($_POST['audate_id'] as $row=>$name) { $audate_id = mysql_real_escape_string($_POST['audate_id'][$row]); $AR[] = "'$audate_id"; } $odbc = "UPDATE Audit SET temp = '$_POST[temp_f]' WHERE audit_id".implode(',', $AR); rs = odbc_exec($conn,$odbc); }
-
Again, for now i need advise if im doing correct.! in this structure i have two connection odbc and mysql. the company has more than 100 branches store nationwide. now every branch are using ms access db and it is stand alone. now head office want to get easier access to get the transaction record from store/branch. now the first thing i do is to view the record using odbc connection and after viewing i save it into mysql. i insert it using array. now to avoid duplicate entry, i need to insert and update in single clicked. and here is the scenario: insert into mysql and update into access. in access db i add field name temp_file since in beginning in view record i create a condition //in access "SELECT A, B, C FROM ACCESSTABLE WHERE temp_file = 'null'"; //to a sure that, that the record is not already in mysqldb. //in mysql "INSERT INTO MYSQLDB(A,B,C)VALUES(P_A,P_B,P_C)"; //in access "UPDATE ACCESSTABLE SET temp_file = 'TEMP_FILE' WHERE id = 'id'";
-
Hi laxi. use array implode to insert multiple of records and from your every text box, create an id to identify array.
-
Hi barand and vinny, in this scenario, i have two kinds of connection, ODBC and MySQL. the use of ODBC is to enable view records in every division and inserting it into MySQL using array. now in every each division there is UNIQUE records from "AUDIT_ID". and thats the only UNIQUE that i found. now since the division are using access there is a possible that there are same AUDIT_ID from other division. but for now i use IGNORE for inserting but it keeping inserting even the records is already there. and i think im doing the right syntax. why and what wrong using IGNORE? is there any other way to avoid duplicate entry even in a one division? and note i use array for insert since it contain hundred thousands of record in just one click.
-
Hi coders, i have more than 100,000 rows of record and now i need it to insert by batch and to do so i need first to insert 10,000 lines/rows for as long as the system not getting log when it inserting. and now how could i avoid to make duplicate entry? and i am trying this code below but im not lack? $array[] = "('$user_name', '$audate_id', '$sid', '$bcode', '$Description', '$type', '$sold', '$audate')"; $sql ='INSERT IGNORE INTO pro_data(username, audate_id, stock_id, barcode, description, type, sold, audate_date) VALUES '.implode(',', $array);
-
Hi coders, do you think it is possible to get the sum of every Individual like below?
-
Just create a class for your objective
- 13 replies
-
- dynamic title
- problem
-
(and 3 more)
Tagged with:
-
what provably say when you run this?
-
Hi. <?php require('fpdf.php'); require('TOURDABASECONNECTION.PHP'); class PDF extends FPDF { function BuildTable($header,$data) { $this->SetFillColor(159,159,158); $this->SetTextColor(0); $this->SetDrawColor(0,0,0); $this->SetLineWidth(.1); $this->SetFont('',''); $w=array(8,35,80,43,30,8,; for($i=0;$i<count($header);$i++) $this->Cell($w[$i],7,$header[$i],1,0,'C',1); $this->Ln(); $this->SetFillColor(201,201,201); $this->SetTextColor(0); $this->SetFont(''); $fill=true; foreach($data as $row) { $this->Cell($w[0],6,$row[0],'LR',0,'C',$fill); $this->Cell($w[1],6,$row[1],'LR',0,'L',$fill); $this->SetTextColor(0); $this->SetFont(''); $this->Cell($w[2],6,$row[2],'LR',0,'L',$fill); $this->Cell($w[3],6,$row[3],'LR',0,'L',$fill); $this->Cell($w[4],6,$row[4],'LR',0,'L',$fill); $this->Cell($w[5],6,$row[5],'LR',0,'C',$fill); $this->Cell($w[6],6,$row[6],'LR',0,'C',$fill); $this->Ln(); $fill =! $fill; } $this->Cell(array_sum($w),0,'','T'); } } $disquery = "Select * from results where Examno = '$exnum'"; $disuser = mysql_query($disquery)or die(mysql_error()); While($row = mysql_fetch_array($disuser)) { $data[] = array( $row['Subcode'], $row['Title'], $row['CIA'], $row['ESE'], $row['Credits'], $row['Grade'], $row['Gradept']); } $pdf = new PDF('P','mm','A3'); $header=array('PAPER CODE','TITLE','CIA','ESE','CREDIT EARNED','GRADE','GRADE POINT'); $pdf->SetFont('Arial','',9); $pdf->AddPage(); $pdf->BuildTable($header,$data); $pdf->Output(); ?>
-
Hi. kindly check this http://forums.phpfreaks.com/topic/281154-3-dependent-drop-down-list/ you found out the solution in the last row of the discussion.
-
Hi, So.. do you mean store personnel should be the one to open up the database to export it? is there is no other way that store personnel cannot touch the database?
-
Hi coders, code below is working good and i confess that, this is not mine but when im trying to import big amount of file, let say 10MB upward. program was starting getting an error below but the data are successfully import. Notice: Undefined variable: data, line 13 Notice: Undefined offset: 30, line84 Notice: Undefined offset: 31, line85 Notice: Undefined offset: 32, line86 Notice: Undefined offset: 33, line87 Notice: Undefined offset: 34, line89 Notice: Undefined offset: 35, line90 Notice: Undefined offset: 36, line91 ... ... .... ... ... and when im importing small amount of data let say 4MB below the program is successfully redirect on this page import.php. if (isset($_FILES['csv']['size']) > 0) { $file = $_FILES['csv']['tmp_name']; $handle = fopen($file,"r"); do { if ($data[0]) { mysql_query("INSERT INTO stock( stock_id, Barcode, PLU, custom1, custom2, sales_prompt, inactive, allow_renaming, allow_fractions, package, tax_components, print_components, description, longdesc, cat1, cat2, goods_tax, cost, sales_tax, sell, quantity, layby_qty, salesorder_qty, date_created, track_serial, static_quantity, bonus, order_threshold, order_quantity, supplier_id, date_modified, freight, tare_weight, unitof_measure, weighted, external) VALUES ( '".addslashes($data[0])."', '".addslashes($data[1])."', '".addslashes($data[2])."', '".addslashes($data[3])."', '".addslashes($data[4])."', '".addslashes($data[5])."', '".addslashes($data[6])."', '".addslashes($data[7])."', '".addslashes($data[8])."', '".addslashes($data[9])."', '".addslashes($data[10])."', '".addslashes($data[11])."', '".addslashes($data[12])."', '".addslashes($data[13])."', '".addslashes($data[14])."', '".addslashes($data[15])."', '".addslashes($data[16])."', '".addslashes($data[17])."', '".addslashes($data[18])."', '".addslashes($data[19])."', '".addslashes($data[20])."', '".addslashes($data[21])."', '".addslashes($data[22])."', '".addslashes($data[23])."', '".addslashes($data[24])."', '".addslashes($data[25])."', '".addslashes($data[26])."', '".addslashes($data[27])."', '".addslashes($data[28])."', '".addslashes($data[29])."', '".addslashes($data[30])."', '".addslashes($data[31])."', '".addslashes($data[32])."', '".addslashes($data[33])."', '".addslashes($data[34])."', '".addslashes($data[35])."') "); } } while ($data = fgetcsv($handle,1000000,",",",")); header('Location:import.php'); }
-
Hi Coders, In the help of this forum and the following member, i get to present my work successfully and i am very thankfull. but now my boss suggest me and he get change his mind. this is: the company is there are 100 more or less store nationwide here in the philippines. the company has already a software called it MYOB. this software is not online, the use of this software is for sales transaction, the software is use an old database MS ACCESS 2003. now it possible to import the datatable from MYOB to MySQL automatically the web page is to set the autoload/refresh in every 1/2 hour to get the file form MYOB. Please advise me, what should i do first since this is my first time to do this?
-
Wow.. JC its really work.. a big thanks JC.. Thank you a lot.
-
no error found and no result found or data found.. and i dont know if mysql allow like syntax below that after "WHERE" there are multiple field name before condition. because the date where i have here is separated field name. table ------------------------------ |month | day | year | ------------------------------ 08 01 2013 08 21 2013 09 17 2013 WHERE rmonth && rday && ryear CONDITION
-
Hi coders, may i ask, how to correct this. "SELECT .... WHERE rmonth && rday && ryear between '$_POST[month1]$_POST[day1]$_POST[year1]' AND '$_POST[month2]$_POST[day2]$_POST[year2]'";
-
SELECT abank.AcctName, abank.BSB1, abank.BSB2, abank.AccNumber, abank.Adviser, abank.Bank, eusers.id FROM abank INNER JOIN eusers ON abank.Adviser=eusers.id; WHERE abank.Adviser = '$_SESSION[uid]'"); TRY:
-
Hi coders, any body help, if possible image below, i use only one submit button? note: page2 is not totally viewing data. Ex. page1 <form name = "form" action = "page2" method = "post"> <input type = "text" name = "search_code" value = ""> <input type = "text" name = "quantity" value = ""> <input type = "submit" name = "submit" value = "submit"> </form> page2 | now here is i need to update first the value of quantity to get the latest value of it. before i add into sold item. $x = mysql_query("UPDATE itemT SET quantity = '$_POST[quantity]' WHERE item_code = '$_POST[search_code]'"); $data_query = mysql_query("SELECT ..... "); if($result) { while($row = mysql_fetch_array($result)) { ?> <input type = "text" name = "item_id" value = "<?php echo $row['item_id']; ?>"> <input type = "text" name = "item_code" value = "<?php echo $row['item_code']; ?>"> <input type = "text" name = "item_name" value = "<?php echo $row['item_name']; ?>"> <input type = "text" name = "sold" value = "<?php echo $row['sold']; ?>"> <input type = "text" name = "quantity" value = "<?php echo $row['quantity']; ?>"> <?php } ## in this part, i am trying to find good solution but not luck and i dont know the right way to out of scenario.## $_POST['sold'] = $_POST['sold'] + $_POST['quantity']; $query_update = mysql_query("UPDATE itemT SET sold = '$_POST[sold]'"); header('Location:page3 or page1'); }
-
It might couse of your condition. $sql = sprintf("SELECT * FROM units WHERE Brand LIKE'$brand' OR Model LIKE'$brand' OR Capacity LIKE'$brand' OR Type LIKE'$brand'"); try it into "==" $sql = sprintf("SELECT * FROM units WHERE Brand = '$brand' OR Model = '$model' OR Capacity = '$capacity' OR Type = '$type'");