Jump to content

oskare100

Members
  • Posts

    69
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

oskare100's Achievements

Member

Member (2/5)

0

Reputation

  1. Hello! I'm wokring on a short URL script. I'll store the shortened URLs in either a text file or MySQL database, which of those two alternatives do you think would be most effective and result in the fastest redirects and lowest system load? Regards Oskar
  2. Hello, Is there in any way (with MySQL or PHP or software) to replace one work with another in all rows in a table? I have about 7000 product descriptions in Swedish and I need to translate them into English. The good thing is that all the description only contain a few words (I think that I just need to replace about 30 words in total to translate everything). The bad thing is that I don't know how to do that. So I want to select all rows with the language id for English (currently all English decriptions are in Swedish) and then replace all occurances of a specific word with another specific word. So UDPATE description ???? WHERE language_id = 5 is what I've figured wold be a start for an MySQL command... the problem is that I don't know what to put instead of ????. Would it be possible to do that in PHP or MySQL? Could you help me with any kind of command (is that how you say it?) or any other help? Regards /Oskar
  3. Solved the problem, used SQL command: "UPDATE products SET products_price=(SELECT test4 FROM dummy WHERE products_id = test1) WHERE products_price = '0.0000' and added the tab separated file to a database.
  4. Hello, I really need help with this ASAP. The prices for 2000 products of 6000 products in my new webshop has dissapeared and the only thing I have is a tab separated price file. Here is how the tab separated price file looks like (a total of 6000 lines): 3713 mobilesp,Reservdelar, battery to Samsung SGH-N400 10 http://www.xxxxxxxxx.com/product_info.php?products_id=3711 3714 testproducts, Test product two 11 http://www.xxxxxxxxx.com/product_info.php?products_id=3712 http://www.xxxxxxxxx.com/images/TAS000335.jpg 3715 mobilesp,Reservdelar,keypad to Siemens S55 10 http://www.xxxxxxxxx.com/product_info.php?products_id=3713 3716 Kameraprodukter, Mobile phone test 12 http://www.xxxxxxxxx.com/product_info.php?products_id=3714 http://www.xxxxxxxxx.com/images/TAS000323.jpg 3717 memoryproducts,Memory card reader 66 http://www.xxxxxxxxx.com/product_info.php?products_id=3715 http://www.xxxxxxxxx.com/images/KAR000234.jpg 3718 mobilesp,Reservdelar, Card for keypad 1 för sony K300, K300i, K310i 10 http://www.xxxxxxxxx.com/product_info.php?products_id=3716 3719 memoryproducts, Memory reader 23 i 1 49 http://www.xxxxxxxxx.com/product_info.php?products_id=3717 http://www.xxxxxxxxx.com/images/KAR000231.jpg The database has the following structure (a total of 6000 rows): INSERT INTO `products` (`products_id`, `products_quantity`, `products_on_order`, `products_model`, `products_image`, `products_price`, `products_date_added`, `products_last_modified`, `products_date_available`, `products_weight`, `products_status`, `products_tax_class_id`, `manufacturers_id`, `suppliers_id`, `products_ordered`, `products_bundle`, `products_thickness`, `products_ean`, `products_comments`) VALUES (1845, 0, 0, '', NULL, 13.1640, '2008-01-29 17:14:40', NULL, NULL, 100.00, 1, 1, 14, 'cable USB-SIE DCA540', 0, '', 10, '', ''), (1846, 0, 0, '', NULL, 61.6680, '2008-01-29 18:37:52', NULL, NULL, 100.00, 1, 1, 14, 'Cable USB LG C3310', 0, '', 10, '', ''), (1847, 0, 0, '', NULL, 5.0000, '2008-01-29 18:43:41', NULL, NULL, 100.00, 1, 1, 14, 'Data cable MOT UC200 ', 0, '', 10, '', ''), (1848, 0, 0, '', 'testimage.jpg', 50.7200, '2008-01-29 18:50:20', NULL, NULL, 100.00, 1, 1, 14, 'Data LG G2030/G2120 7130', 0, '', 10, '', ''), (1849, 0, 0, '', NULL, 53.3120, '2008-01-29 18:56:22', NULL, NULL, 100.00, 1, 1, 14, 'Data BEN/SIE S68, 0, '', 10, '', ''), (1850, 0, 0, '', 'KAGG553.jpg', 46.8760, '2008-01-29 19:02:36', NULL, NULL, 100.00, 1, 1, 14, 'Data L5100', 0, '', 10, '', ''), In the end of each URL on each line of the price file there are an ID ("....o.php?products_id=3716"). There is also a price on each line in the price file, as for example "12" on the line whith the product ID 3716 in the sample price file above. 1) First the script needs to find the product ID and price on each line of the price file. 2) Then the script needs to select the product with that product ID in the database and update the price to the price from the price file. In other words, with for example product 3716 the script should select the row with the products_id 3716 and then set the products_price to 12. I'm not good at PHP but I've figured out that it needs to be a loop that goes through all lines of the tab separated price file. What I don't know is how to do that, I've never worked with tab separated text files before in PHP. Then it should probably be a much easier way to do this since it's a tab separated price file but what I thought is that when the script has selected the line it should search for "....product_info.php?products_id=" and assing a variable to the following letters. Then the price is just before the "http://ww..." so that should be to just find and assign a variable to the price that comes before that. But then the script wouldn't take any advantage of that it's a tab separated file.... I really appreciate all help I can get. I've worked with adding all these products for three a months. Thanks in advance, Oskar R
  5. Hello, I've a request that looks about like this: $request_url1 = "http://api.ddddddd.com/http/auth?api_id=$ddd_appid&user=$ddd_user&password=$ddd_passw"; $request_sessionid = file_get_contents($request_url1); Back from that I should get an ID I need to include in another request, if I write the address in a normal browser the response looks like this: OK: 464fhjolilw8ad6awde8844 So when I make the request to http://api.ddddddd.com/http/auth?api_id=$ddd_appid&user=$ddd_user&password=$ddd_passw I need to assign the ID I get back (464fhjolilw8ad6awde8844 in this case) to a variable so I can use it in another request, but I can't figure out how to do that so I need help... /Oskar
  6. Hello, I have the following code: $request = file_get_contents($request_url) or die("feed not loading"); If the file_get_contents($request_url) doesn't load/respond then the script echoes "feed not loading" and stops. I want the script to echo "feed not loading" and then continue and just skip that part of the script that needed the file contents. Is that possible? Best Regards Oskar R
  7. Hello, This is the code snippet: $breadcrumbtrail = $breadcrumb->trail(' » '); $breadcrumbexploded = explode(";", $breadcrumbtrail); echo $breadcrumbexploded[0]; if ($breadcrumbexploded[0] == "&RAQUO") { echo "true"; } else { echo "false"; } That code returns the text "&RAQUOfalse" but it should return "&RAQUOtrue" since $breadcrumbexploded[0] == "&RAQUO". I can't figure out why it can't understand that $breadcrumbexploded[0] actuallt is &RAQUO. Best Regards Oskar R
  8. Hello, I'm trying to prase and use information I'm getting from an XML API in my system. The user is supposed to be able to choose between the returned agents and then select one of them. When they click "continue" or similar the rows of the agent that the user selected should be saved/assaigned to different PHP variables. Here is the structure of the XML return: <xml> <system> <error> <id>0</id> <message>Your request was successfully processed.</message> 7</error> </system> <response> <service> <name>Agents</name> <version>10</version> </service> <data_list_count>2</data_list_count> </response> <data_list> <data index="0"> <agent_list> <agent index="0"> <name>AGENT & CO IT</name> <address>STREET ADDRESS 2</address> <address2/> <zipcode>500000</zipcode> <city>TOWN</city> <agent_number>0661</agent_number> </agent> <agent index="1"> <name>ANOTHER AGENT</name> <address>STREET ADDRESS 5</address> <address2/> <zipcode>600000</zipcode> <city>CITY</city> <agent_number>0662</agent_number> </agent> </agent_list> </data> </data_list> </xml> Now I need to list the agents so that the user can select one of them.. I've understood that I should use SimpleXML for this since it is the easiest way. $xml = simplexml_load_file($request_url) or die("feed not loading"); That about what I've managed to do, I understand that in some way I need to list the different agents. foreach ($xml-> ...? ) ( print ? ) Then I would need to add so that the user can select one of the returned agents and click continue and that my script then can get the rows/information about the selected agent. Maybe HTML POST/GET but I don't know how to make it do that... I appreciate any help, links, code or whatever I can use to solve this problem. Thanks /Oskar
  9. Hello, I've managed to recieve all messages from Ebay within the data range I specified with the call GetMemberMessages (http://developer.ebay.com/DevZone/XML/docs/Reference/eBay/io_GetMemberMessages.html) but I have one problem left I really need help with. Here is the code I used: <?php include('functions.php'); include('variables.php'); error_reporting(E_ALL); ini_set('display_errors', '1'); //SiteID must also be set in the Request's XML //SiteID = 0 (US) - UK = 3, Canada = 2, Australia = 15, .... //SiteID Indicates the eBay site to associate the call with $siteID = 0; //the call being made: $verb = 'GetMemberMessages'; //Regulates versioning of the XML interface for the API $compatabilityLevel = 433; //get an array of strings containing the required headers $headers = buildEbayHeaders($devID, $appID, $certID, $compatabilityLevel, $siteID, $verb); // Time from and time to $time_from = date('Y-m-d\TH:i:s',strtotime("-10 days")).'.799Z'; $time_to = date('Y-m-d\TH:i:s',strtotime("+ 1 day")).'.799Z'; ///Build the request Xml string $requestXmlBody = '<?xml version="1.0" encoding="utf-8">'; $requestXmlBody .= '<GetMemberMessagesRequest xmlns="urn:ebay:apis:eBLBaseComponents">'; $requestXmlBody .= "<RequesterCredentials><eBayAuthToken>$userToken</eBayAuthToken></RequesterCredentials>"; $requestXmlBody .= "<MailMessageType>All</MailMessageType>"; $requestXmlBody .= "<EndCreationTime>$time_to</EndCreationTime>"; $requestXmlBody .= "<StartCreationTime>$time_from</StartCreationTime>"; $requestXmlBody .= '</GetMemberMessagesRequest>'; $responseXml = sendHttpRequest($requestXmlBody, $serverUrl, $headers); if(stristr($responseXml, 'HTTP 404') || $responseXml == '') die('<P>Error sending request'); //Xml string is parsed and creates a DOM Document object $responseDoc = domxml_open_mem($responseXml); //get any error nodes $errors = $responseDoc->get_elements_by_tagname('Errors'); //if there are error nodes if(count($errors) > 0) { echo '<P><B>eBay returned the following error(s):</B>'; //display each error //Get error code, ShortMesaage and LongMessage $code = $errors[0]->get_elements_by_tagname('ErrorCode'); $shortMsg = $errors[0]->get_elements_by_tagname('ShortMessage'); $longMsg = $errors[0]->get_elements_by_tagname('LongMessage'); //Display code and shortmessage echo '<P>', $code[0]->get_content(), ' : ', str_replace(">", ">", str_replace("<", "<", $shortMsg[0]->get_content())); //if there is a long message (ie ErrorLevel=1), display it if(count($longMsg) > 0) echo '<BR>', str_replace(">", ">", str_replace("<", "<", $longMsg[0]->get_content())); } else //no errors { //get results nodes $itemNodes = $responseDoc->get_elements_by_tagname('MemberMessage'); foreach($itemNodes as $item){ $message = $item->get_elements_by_tagname('MemberMessageExchange'); { //display all the elements of each item foreach($item->child_nodes() as $itemChild) echo $itemChild->get_content(); } } } ?> The problem is that when I run that code I get all information back - everything - item numbers, emails, questions and everything else. I've no idea of how to select the information I want to use. That's what I really need help with. I tried to use echo $itemChild->get_content('SenderEmail'); to get only the sender email but it didn't work, I still got everything back. I'm really greatful for any help I can get. Thanks in advance, Oskar R
  10. Hello, I'm trying to get this code to work: $item_number="5161516161,784684664864684"; $item_numbers = explode(",", $item_number); foreach ($item_numbers as &$item_number) { echo "$item_number"; ) I need it to split the 5161516161,784684664864684 and run " echo "$item_number"; " twice, one for each item number. So if $item_number="5161516161,784684664864684,15515151"; then the script is supposed to run " echo "$item_number"; " three times, one time for each item number. Please help, how can I do that? What is wrong with my code/how should it be? /Oskar
  11. Hello, I've a download script as shown in this post. My problem is that regarless of what I write in $path and $webaddress the script uses PHP and works! I need to be able to change it so it uses FTP instead of HTTP, can somebody please help? I would be very greatful if someone can help me with this! Here is the script: <?php session_start(); include 'db_info.php'; //path to files. $path = "/home/domains/nddownl/"; // address to files. Remember trailing slash. if($_GET['type'] == 'ftp') { $webaddress = "ftp://username:password@domain.com/"; } elseif ($_GET['type'] == 'http') { $webaddress = "http://username:password@domain.com/nddownl/"; } else { echo "specify type"; } //if this is set to 1, users without information on where they came from will still see your files. This is recommended, as some user's browsers block the //referrer information - we don't want to lock anyone legitimate out. Set to 0 to disable.// $allowblank = 1; // Logging, 1 to enable, 2 t odisable $logging = 1; // Domains from where the files can be downloaded $alloweddomains = array('ventiero.com'); $allowed = 1; //path to files. $path = "/home/domains/nddownl/"; // Connect to MySQL and select database mysql_connect("$sqlhost", "$sqlusername", "$sqlpassword")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $cl="SELECT * FROM $user_tbl WHERE user_id='".mysql_real_escape_string($_SESSION['vuserid'])."' and password='".mysql_real_escape_string($_SESSION['vpassword'])."'"; $clresult=mysql_query($cl); if(mysql_num_rows($clresult) == 1) { //continue, user is logged in. } else { echo "You are not logged in"; die; } $allowed = 0; if($allowblank > 0) { if($_SERVER['HTTP_REFERER']=="") { $allowed = 1; }} $domains = count($alloweddomains); for($y=0;$y<$domains+1;$y++) { if((stristr($_SERVER['HTTP_REFERER'], $alloweddomains[$y]))) { $allowed = 1;} } if($allowed > 0) { } else { $status = 'Denied'; mysql_query("INSERT INTO downl_logs (user_id, file_id, ip, refer, status, logged) VALUES('".$_SESSION['vuserid']."', '".$_GET['file']."', '".$_SERVER['REMOTE_ADDR']."', '".$_SERVER['HTTP_REFERER']."', '$status', NOW()) ") or die(mysql_error()); echo "You do not have permission to download this file."; die; } if(!isset($_GET['file']) || $_GET['file'] != (string) (int) $_GET['file'] || (int) $_GET['file'] <= 0) { die('Parameter `file` must be a positive integer.'); } // Make sure that the user has permission to download the file $result5 = mysql_query("SELECT cat_id, list_id FROM files WHERE file_id='".mysql_real_escape_string($_GET['file'])."'") or die( mysql_error() ); $row1 = mysql_fetch_assoc($result5); $result4 = mysql_query("SELECT pack_id FROM file_cats WHERE cat_id ='".$row1['cat_id']."'") or die( mysql_error() ); $row2 = mysql_fetch_assoc($result4); $result3 = mysql_query("SELECT * FROM $sales_tbl WHERE user_id = '".$_SESSION['vuserid']."' AND (file_id='".$_GET['file']."' OR pack_id='".$row2['pack_id']."' OR list_id='".$row1['list_id']."') ") or die( mysql_error() ); if(mysql_num_rows($result3)>0){ // Continue if the user has permission to download the file }else{ // Exit if the user doesn't have permission to download the file echo "You do not have permission to download this file"; die; } // Make sure the full filename exists and get it $result = mysql_query("select file_name from $file_tbl where file_id = '".$_GET['file']."'") or die( mysql_error() ); if(0 == mysql_num_rows($result)) { die('File not found.'); } $fileName = mysql_result($result, 0, 0) or die('Unable to retrieve result: '.mysql_error($conn)); $extension = (FALSE !== ($pos = strrpos($fileName, '.'))) ? substr($fileName, $pos + 1) : ''; // The content types switch($extension) { case 'avi': $ct = 'video/avi'; break; case 'bmp': $ct = 'image/bmp'; break; case 'gif': $ct = 'image/gif'; break; case 'jpeg': case 'jpg': case 'jpe': $ct = 'image/jpeg'; break; case 'mov': $ct = 'video/quicktime'; break; case 'mpeg': case 'mpg': case 'mpe': $ct = 'video/mpeg'; break; case 'png': $ct = 'image/png'; break; case 'swf': $ct = 'application/x-shockwave-flash'; break; case 'wmv': $ct = 'video/x-ms-wmv'; break; case 'rar': case 'zip': $ct = 'application/octet-stream'; break; //end content types default: $ct = 'application/octet-stream'; if($logging) { $status = 'Generic_Filetype'; mysql_query("INSERT INTO downl_logs (user_id, file_id, ip, refer, status, logged) VALUES('".$_SESSION['vuserid']."', '".$_GET['file']."', '".$_SERVER['REMOTE_ADDR']."', '".$_SERVER['HTTP_REFERER']."', '$status', NOW()) ") or die(mysql_error()); } } // Open the file that the user will download $handle = @fopen($path.$fileName, 'rb') or die('Unable to select file.'); if(!$handle) { die('Unable to transer file.'); } header('Cache-Control: '); //keeps ie happy header('Pragma: '); //keeps ie happy header('Content-Type: '.$ct); if('swf' != $extension) //flash plays, it isnt downloaded as an actual file. { header('Content-Disposition: attachment; filename="'.$fileName.'"'); } header('Content-Length: '.filesize($path.$fileName)); fpassthru($handle); if($logging) { $status = 'Granted'; // Log the download in the download logs table mysql_query("INSERT INTO downl_logs (user_id, file_id, ip, refer, status, logged) VALUES('".$_SESSION['vuserid']."', '".$_GET['file']."', '".$_SERVER['REMOTE_ADDR']."', '".$_SERVER['HTTP_REFERER']."', '$status', NOW()) ") or die(mysql_error()); // Log the download in the user table mysql_query("UPDATE $user_tbl SET num_downloads=num_downloads+1 where user_id = '".$_SESSION['vuserid']."'") or die( mysql_error() ); } ?> Thanks in advance, Oskar
  12. Hello, I'm currently using this page to get information about the buyers email, Ebay status and the Ebay transaction ID of a transaction at Ebay. The problem is that I also need to get some more information from the XML reply, but I don't know how to do it. Here is the page: <?php if ($_POST['itemid'] == ""){ print "<form name='form1' method='post' action='GetItemTransactionss.php'>"; print "<input name='itemid' type='text' id='itemid'>"; print "<input name='userid' type='text' id='userid'>"; print "<input type='submit' name='Submit0' value='Post'>"; } else { include('functions.php'); include('variables.php'); error_reporting(E_ALL); ini_set('display_errors', '1'); //SiteID must also be set in the Request's XML //SiteID = 0 (US) - UK = 3, Canada = 2, Australia = 15, .... //SiteID Indicates the eBay site to associate the call with $siteID = 0; //the call being made: $verb = 'GetItemTransactions'; //Regulates versioning of the XML interface for the API $compatabilityLevel = 433; //get an array of strings containing the required headers $headers = buildEbayHeaders($devID, $appID, $certID, $compatabilityLevel, $siteID, $verb); $item_number=$_POST['itemid']; $user_id=$_POST['userid']; // Time from and time to $time_from = date('Y-m-d\TH:i:s',strtotime("-28 days")).'.799Z'; $time_to = date('Y-m-d\TH:i:s',strtotime("+1 days")).'.799Z'; ///Build the request Xml string $requestXmlBody = '<?xml version="1.0" encoding="utf-8"?>'; $requestXmlBody .= '<GetItemTransactionsRequest xmlns="urn:ebay:apis:eBLBaseComponents">'; $requestXmlBody .= "<RequesterCredentials><eBayAuthToken>$userToken</eBayAuthToken></RequesterCredentials>"; $requestXmlBody .= "<ItemID>$item_number</ItemID>"; $requestXmlBody .= "<ModTimeFrom>$time_from</ModTimeFrom>"; $requestXmlBody .= "<ModTimeTo>$time_to</ModTimeTo>"; $requestXmlBody .= '</GetItemTransactionsRequest>'; $responseXml = sendHttpRequest($requestXmlBody, $serverUrl, $headers); if(stristr($responseXml, 'HTTP 404') || $responseXml == '') die('<P>Error sending request'); //Xml string is parsed and creates a DOM Document object $responseDoc = domxml_open_mem($responseXml); //get any error nodes $errors = $responseDoc->get_elements_by_tagname('Errors'); //if there are error nodes if(count($errors) > 0) { echo '<P><B>eBay returned the following error(s):</B>'; //display each error //Get error code, ShortMesaage and LongMessage $code = $errors[0]->get_elements_by_tagname('ErrorCode'); $shortMsg = $errors[0]->get_elements_by_tagname('ShortMessage'); $longMsg = $errors[0]->get_elements_by_tagname('LongMessage'); //Display code and shortmessage echo '<P>', $code[0]->get_content(), ' : ', str_replace(">", ">", str_replace("<", "<", $shortMsg[0]->get_content())); //if there is a long message (ie ErrorLevel=1), display it if(count($longMsg) > 0) echo '<BR>', str_replace(">", ">", str_replace("<", "<", $longMsg[0]->get_content())); } else //no errors { //get results nodes $transactionNodes = $responseDoc->get_elements_by_tagname('Transaction'); $transaction_id=-1; foreach ($transactionNodes as $key=>$node){ $buyer=$node->get_elements_by_tagname("Buyer"); $userid=$buyer[0]->get_elements_by_tagname("UserID"); if($userid[0]->get_content()==$user_id) $transaction_id=$key; } if($transaction_id!=-1){ $transaction=$transactionNodes[$transaction_id]->get_elements_by_tagname("TransactionID"); $ebay_transaction_id = $transaction[0]->get_content(); $ebaystatus=$transactionNodes[$transaction_id]->get_elements_by_tagname("Status"); $ebay_status = $ebaystatus[0]->get_content(); $ebayemail=$transactionNodes[$transaction_id]->get_elements_by_tagname("Email"); $ebay_email = $ebayemail[0]->get_content(); echo "$ebay_transaction_id"; echo "$ebay_status"; echo "$ebay_email"; } } } ?> Here is the structure of the reply from Ebay: http://developer.ebay.com/DevZone/XML/docs/Reference/eBay/io_GetItemTransactions.html . I need to be able to get information from different places of the transaction part of the XML reponse, not just from "buyer" as for example I need to get <ExternalTransactionID> from <ExternalTransaction> and the <PaidTime> and similar from that <transaction> with that <UserID> . So I can be able to use the different levels, as for example to get TransactionArray.Transaction.Buyer.BuyerInfo.ShippingAddress.Name for that user and transaction. I've tried for several hours now to get this to work, so please, help me! If you PM your Paypal email I'll also leave compensation for your time if it works - I really need this to work. Thanks in advance, /Oskar
  13. Hello, I've this PHP script that should be able to identify; $mysql = mysql_connect($host, $username, $password)or die(mysql_error()); mysql_select_db($db_name, $mysql)or die(mysql_error()); $item_name= mysql_real_escape_string($item_name); $query="SELECT * FROM `items` WHERE `price` = $mc_gross AND ('$item_name' LIKE `identify_pos` AND '$item_name' LIKE `identify_pos2`) AND ('$item_name' NOT LIKE `identify_neg` AND '$item_name' NOT LIKE `identify_neg2`) "; $result = mysql_query($query) or die(mysql_error()); if ( false===($ident_row=mysql_fetch_assoc($result)) ) { // No row found die; } else { echo 'item_id: ', $ident_row['item_id'], "<br />\n"; } Here is the current database structure: -- -- Table structure for table `items` -- CREATE TABLE `items` ( `item_id` int(11) NOT NULL auto_increment, `item_name` varchar(100) NOT NULL default '', `price` varchar(10) NOT NULL default '0', `identify_pos` varchar(50) NOT NULL default '', `identify_pos2` varchar(50) NOT NULL default '', `identify_neg` varchar(50) NOT NULL default '', `identify_neg2` varchar(50) NOT NULL default '', `file_id` int(10) NOT NULL default '0', `pack_id` int(10) NOT NULL default '0', `list_id` int(5) NOT NULL default '0', PRIMARY KEY (`item_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ; -- -- Dumping data for table `items` -- INSERT INTO `items` (`item_id`, `item_name`, `price`, `identify_pos`, `identify_pos2`, `identify_neg`, `identify_neg2`, `file_id`, `pack_id`, `list_id`) VALUES (1, 'Package 1', '2.95', '%15GB%', '%templates%', '', '', 0, 1, 0), (2, 'Package 2', '2.95', '', '', '%15gb%', '%templates%', 0, 2, 0); In other words, package 1 has the words %15GB% and %templates% as positive identify words (that the title should contain to be package 1) and Package 2 has the words as negative indentify words (words that the title shouldn't contain to be package 2. I hoped that the above structure would result in that all titles that contain 15GB and Templates are identified as Package 1 (and that works good) and that all other item titles that doesn't include the words 15GB and templates would automaticly be identified as Package 2 but that's the problem. If a title doesn't cotain 15gb or templates the script dies without any result. I really need help with this so any info is appreciated. Best Regards Oskar R
  14. Hello, I need to select all rows * from a MySQL database where the dec column ends with 0 (or contains 0 if it is easier). How can I do that? Best Regards
  15. Hello, When I run this code: [code=php:0]$sql55="INSERT INTO users (username, password, ebay_username, ebay_status, ebay_email, paypal_status, paypal_email, num_purchases, first_name, last_name, address_street, address_city, address_state, address_zip, address_country, address_status, created) VALUES('".$row->account_username."', '".$row->account_password."', '".$row->auction_buyer_id."', '$ebay_status', '".$row->account_email."', '".$row->payer_status."', '".$row->account_email."', 1, '".$row->first_name."', '".$row->last_name."', '".$row->address_street."', '".$row->address_city."', '".$row->address_state."', '".$row->address_zip."', '".$row->address_country."', '".$row->address_status."', '$new_script_received')"; $result55 = mysql_query($sql55) or die( mysql_error() );[/code] I get the error "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'S ROAD'," Now it seams like the problem is this field "51 ST SIMONS'S ROAD" and I think the problem is the ', correct me if I'm wrong. How can I solve this problem? (It is a lot of rows I'm running this querey on so I can't just insert it manually). Thanks in advance, Best Regards Oskar R
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.