Jump to content

adamjnz

Members
  • Posts

    30
  • Joined

  • Last visited

    Never

Everything posted by adamjnz

  1. This has the same result as originally reported in the thread.
  2. [quote author=fenway link=topic=111020.msg455929#msg455929 date=1161548246] Sorry I never got back to this... that query may work, but the "subquery" is really just a unnamed view a.k.a. derived table, which should be fine.  But only if the word select is inside the parentheses -- otherwise, you'll get a syntax error on all versions. [/quote] I tired putting select in the brackets but still getting exactly the same error message. Query was: SELECT BlogPost.BlogPostID , ImgSrc , PostTitle , PostText , BlogPost.DateTime , Category , Deleted , User.Name , x.commentcount AS CommentCount FROM BlogPost JOIN User on BlogPost.userID=User.userID   LEFT JOIN (select BlogPostID, count(*) as commentcount from BlogPostComment) x       ON BlogPost.BlogPostID = x.BlogPostID WHERE BlogPost.Deleted = '0' GROUP BY BlogPost.BlogPostID ORDER BY BlogPost.BlogPostID
  3. A friend at work (An SQL Guru of sorts) suggested the following query, however he used MS SQL and MySQL Doesnt seem to like the subquery (in the brackets) and throws an error... --------------------------------------------------------------------------------------------- SELECT BlogPost.BlogPostID , ImgSrc , PostTitle , PostText , BlogPost.DateTime , Category , Deleted , User.Name , x.commentcount AS CommentCount FROM BlogPost JOIN User on BlogPost.userID=User.userID LEFT JOIN select(BlogPostID, count(*) as commentcount from BlogPostComment) x ON BlogPost.BlogPostID = x.BlogPostID WHERE BlogPost.Deleted = '0' GROUP BY BlogPost.BlogPostID ORDER BY BlogPost.BlogPostID ------------------------------------------------------------------------------------- Comments? Thoughts?
  4. I will try and put it in better context, here is what I am trying to do: 1)       Pull BlogPostID, ImgSrc, PostTitle, PostText, BlogPost.DateTime, Category, Deleted values from the BlogPost table 2)       Pull the Name value from the User table based on the UserID stored against the record in the BlogPost table. 3)       Calculate the number of comments linked to a BlogPost from the BlogPostComment table based on the BlogPostID stored in the BlogPost table. The following query works fine for points 1 & 2 but when I try and add point 3 into the mix with the 2nd query it does the following to the results: 1)       Adds up the total comments for all blog posts and return the value to each record returned 2)       Stop returning the Name for the User table for all but the first record returned. [u][b]Points 1 & 2:[/b][/u] SELECT BlogPost.BlogPostID, ImgSrc, PostTitle, PostText, BlogPost.DateTime, Category, Deleted, User.Name FROM BlogPost JOIN User USING (userID) WHERE BlogPost.Deleted = '0' [b]Returns something like:[/b] [table]   [tr]     [td]Record [/td]     [td]BlogPostID [/td]     [td]ImgSrc [/td]     [td]PostTitle [/td]     [td]PostText [/td]     [td]DateTime [/td]     [td]Category [/td]     [td]Deleted [/td]     [td]Name [/td]   [/tr]   [tr]     [td]1 [/td]     [td]00001 [/td]     [td]Post1.jpg [/td]     [td]Title 1 [/td]     [td]Text 1… [/td]     [td]2006-10-10…. [/td]     [td]Other [/td]     [td]0 [/td]     [td]Adam Jobbins [/td]   [/tr]   [tr]     [td]2 [/td]     [td]00002 [/td]     [td]Post2.jpg [/td]     [td]Title 2 [/td]     [td]Text 2… [/td]     [td]2006-10-10…. [/td]     [td]Announcements [/td]     [td]0 [/td]     [td]Test User 2 [/td]   [/tr]   [tr]     [td]N [/td]     [td]0000N [/td]     [td]PostN.jpg [/td]     [td]Title N [/td]     [td]Text N… [/td]     [td]2006-10.. [/td]     [td]Whatever [/td]     [td]0 [/td]     [td]Users Name [/td]   [/tr] [/table] [u][b]Points 1, 2 & 3:[/b][/u] SELECT BlogPost.BlogPostID, ImgSrc, PostTitle, PostText, BlogPost.DateTime, Category, Deleted, User.Name, COUNT(BlogPostComment.BlogCommentID) AS CommentCount FROM BlogPost JOIN User USING (userID) RIGHT JOIN BlogPostComment ON BlogPost.BlogPostID = BlogPostComment.BlogPostID WHERE BlogPost.Deleted = '0' GROUP BY BlogPostID [b]Returns something like: (2 Records Total in the BlogPostComment table, both linked to BlogPostID = 00001)[/b] [table]   [tr]     [td]Record [/td]     [td]BlogPostID [/td]     [td]ImgSrc [/td]     [td]PostTitle [/td]     [td]PostText [/td]     [td]DateTime [/td]     [td]Category [/td]     [td]Deleted [/td]     [td]Name [/td]     [td]CommentCount [/td]   [/tr]   [tr]     [td]1 [/td]     [td]00001 [/td]     [td]Post1.jpg [/td]     [td]Title 1 [/td]     [td]Text 1… [/td]     [td]2006-10-10…. [/td]     [td]Other [/td]     [td]0 [/td]     [td]Adam Jobbins [/td]     [td]2 [/td]   [/tr]   [tr]     [td]2 [/td]     [td]00002 [/td]     [td]Post2.jpg [/td]     [td]Title 2 [/td]     [td]Text 2… [/td]     [td]2006-10-10…. [/td]     [td]Announcements [/td]     [td]0 [/td]     [td][/td]     [td]2 [/td]   [/tr]   [tr]     [td]N [/td]     [td]0000N [/td]     [td]PostN.jpg [/td]     [td]Title N [/td]     [td]Text N… [/td]     [td]2006-10.. [/td]     [td]Whatever [/td]     [td]0 [/td]     [td][/td]     [td]2 [/td]   [/tr] [/table] [b]SHOULD RETURN:[/b] [table]   [tr]     [td]Record [/td]     [td]BlogPostID [/td]     [td]ImgSrc [/td]     [td]PostTitle [/td]     [td]PostText [/td]     [td]DateTime [/td]     [td]Category [/td]     [td]Deleted [/td]     [td]Name [/td]     [td]CommentCount [/td]   [/tr]   [tr]     [td]1 [/td]     [td]00001 [/td]     [td]Post1.jpg [/td]     [td]Title 1 [/td]     [td]Text 1… [/td]     [td]2006-10-10…. [/td]     [td]Other [/td]     [td]0 [/td]     [td]Adam Jobbins [/td]     [td]2 [/td]   [/tr]   [tr]     [td]2 [/td]     [td]00002 [/td]     [td]Post2.jpg [/td]     [td]Title 2 [/td]     [td]Text 2… [/td]     [td]2006-10-10…. [/td]     [td]Announcements [/td]     [td]0 [/td]     [td]Test User 2 [/td]     [td]0 [/td]   [/tr]   [tr]     [td]N [/td]     [td]0000N [/td]     [td]PostN.jpg [/td]     [td]Title N [/td]     [td]Text N… [/td]     [td]2006-10.. [/td]     [td]Whatever [/td]     [td]0 [/td]     [td]Users Name [/td]     [td]N [/td]   [/tr] [/table]
  5. [quote author=fenway link=topic=111020.msg449898#msg449898 date=1160494244] Very strange looking query... I'm not sure what you mean by (1); as for (2), you have what looks like the right GROUP BY statement, so I'm confused. [/quote] Ok, so for 1) it should be returning the Name of the person who wrote the post, this is got by taking the UserID and looking it up in the User table and returning the associated username. However, it is only returning a result for the 1st record returned by the query, all other results this feild returns nothing. 2) This is working but it is giving me the total for all blog posts, not just the blog post the comments are related to. Hope this makes sense
  6. UPDATE: After fiddling with the code I can finally get it to run something without errors, however there are 2 problems:( 1) It will only return a Name from User.Name for the first result 2) The comment count is an aggregate for all Blog Posts, where I want it to be for each Blog Post Any ideas? [code]SELECT BlogPost.BlogPostID, ImgSrc, PostTitle, PostText, BlogPost.DateTime, Category, Deleted, User.Name, COUNT(BlogPostComment.BlogCommentID) AS CommentCount FROM BlogPost JOIN User USING (userID) RIGHT JOIN BlogPostComment ON BlogPostComment.BlogPostID = BlogPost.BlogPostID WHERE BlogPost.Deleted = '0' GROUP BY BlogPostID[/code]
  7. Hey Guys, I downloaded a tutorial on joining MySQL tables in a query from DMXZone however what I am trying to do goes slightly past the scope of that tutorial. I have tried playing around with the SQL query I want but cannot get it to work. If someone has some insight into this it would be much appreciated. The query as I was trying it: [code]SELECT BlogPostID, ImgSrc, PostTitle, PostText, DateTime, Category, Deleted, User.Name, COUNT(`BlogPostComment.BlogCommentID`) AS `CommentCount` FROM BlogPost JOIN User USING (userID) JOIN BlogPostComment USING (BlogPostID) WHERE BlogPost.Deleted = '0'[/code] Essentially what I am trying to do is this: 1) Pull the blog post data out of the 'BlogPost' Table 2) Crossreference the UserID stored in the 'BlogPost' table to pull out the Full Name of the Author from the 'User' Table 3) Count the number of comments for that particular blog post from the 'BlogPostComment' table using the BlogPostID I can get 1 and 2 working togeather fine, but when I try and add in step 3 it all goes pear shaped (including telling me that DateTime is not ambiguous  ???)
  8. What I am trying to do is get the total of items sold from a table. On the site when the user places an order is stores their username, product, quantity, price etc in a table called order_products. I have an SQL query that filters the results by the username (as to only get the results for the person in question) What I need to be able to do is say something like "Hey, since you signed up you have ordered a total of XXXXX products! - Your best selling product is XXXXXX" I would really appreciate a point in the right direction.
  9. Solved now. I copied and pasted my code out of the PHP file and pasted it back in bit by bit to try and find the errors. But once it was all pasted back in it worked fine.
  10. [!--quoteo(post=365456:date=Apr 17 2006, 05:00 PM:name=ypirc)--][div class=\'quotetop\']QUOTE(ypirc @ Apr 17 2006, 05:00 PM) [snapback]365456[/snapback][/div][div class=\'quotemain\'][!--quotec--] It means if your code has an error and complains about it to the browser, it is sending headers. Also, if you look at your code you have session_start() twice...remove the second one and that will probably solve your problem. [/quote] Still get same error
  11. [!--quoteo(post=365453:date=Apr 17 2006, 04:41 PM:name=ypirc)--][div class=\'quotetop\']QUOTE(ypirc @ Apr 17 2006, 04:41 PM) [snapback]365453[/snapback][/div][div class=\'quotemain\'][!--quotec--] If your code is spitting out another error that counts as html too.[/quote] I don't know what this means [!--quoteo(post=365453:date=Apr 17 2006, 04:41 PM:name=ypirc)--][div class=\'quotetop\']QUOTE(ypirc @ Apr 17 2006, 04:41 PM) [snapback]365453[/snapback][/div][div class=\'quotemain\'][!--quotec--]Also, why are you initializing the session twice?[/quote] Didn't know I was
  12. I am having a 'Cannot modify header information - headers already sent' problem. I have read the other posts about the cause being trying to send header information AFTER the HTML starts. I have checked my code and the line it is erroring on is BEFORE the HTML starts. Any idea what would cause this? [code]<?php require_once('../Connections/ppl_frontend.php'); ?> <?php require_once('../Connections/ppl_frontend.php'); ?> <?php //initialize the session session_start(); // ** Logout the current user. ** $logoutAction = $_SERVER['PHP_SELF']."?doLogout=true"; if ((isset($_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){   $logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_GET['doLogout'])) &&($_GET['doLogout']=="true")){   //to fully log out a visitor we need to clear the session varialbles   session_unregister('MM_Username');   session_unregister('MM_UserGroup');        $logoutGoTo = "./";   if ($logoutGoTo) {     header("Location: $logoutGoTo");     exit;   } } ?> <?php session_start(); $MM_authorizedUsers = "Administrator"; $MM_donotCheckaccess = "false"; // *** Restrict Access To Page: Grant or deny access to this page function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {   // For security, start by assuming the visitor is NOT authorized.   $isValid = False;   // When a visitor has logged into this site, the Session variable MM_Username set equal to their username.   // Therefore, we know that a user is NOT logged in if that Session variable is blank.   if (!empty($UserName)) {     // Besides being logged in, you may restrict access to only certain users based on an ID established when they login.     // Parse the strings into arrays.     $arrUsers = Explode(",", $strUsers);     $arrGroups = Explode(",", $strGroups);     if (in_array($UserName, $arrUsers)) {       $isValid = true;     }     // Or, you may restrict access to only certain users based on their username.     if (in_array($UserGroup, $arrGroups)) {       $isValid = true;     }     if (($strUsers == "") && false) {       $isValid = true;     }   }   return $isValid; } $MM_restrictGoTo = "login.php"; if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {     $MM_qsChar = "?";   $MM_referrer = $_SERVER['PHP_SELF'];   if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";   if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)   $MM_referrer .= "?" . $QUERY_STRING;   $MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);   header("Location: ". $MM_restrictGoTo);   exit; } ?> <?php mysql_select_db($database_ppl_frontend, $ppl_frontend); $query_admin = "SELECT * FROM ppl_admin"; $admin = mysql_query($query_admin, $ppl_frontend) or die(mysql_error()); $row_admin = mysql_fetch_assoc($admin); $totalRows_admin = mysql_num_rows($admin); mysql_select_db($database_ppl_frontend, $ppl_frontend); $query_products = "SELECT * FROM ppl_products"; $products = mysql_query($query_products, $ppl_frontend) or die(mysql_error()); $row_products = mysql_fetch_assoc($products); $totalRows_products = mysql_num_rows($products); mysql_select_db($database_ppl_frontend, $ppl_frontend); $query_orders = "SELECT * FROM ppl_orders ORDER BY orderID DESC"; $orders = mysql_query($query_orders, $ppl_frontend) or die(mysql_error()); $row_orders = mysql_fetch_assoc($orders); $totalRows_orders = mysql_num_rows($orders); ?> <?php function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") {   $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;   switch ($theType) {     case "text":       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";       break;         case "long":     case "int":       $theValue = ($theValue != "") ? intval($theValue) : "NULL";       break;     case "double":       $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";       break;     case "date":       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";       break;     case "defined":       $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;       break;   }   return $theValue; } $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) {   $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } ?> <?php do { ?> <?php if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "add_user")) {   $insertSQL = sprintf("INSERT INTO ppl_user_products (username, productID, product_price, product_quantity) VALUES (%s, %s, %s, %s)",                        GetSQLValueString($_POST['username'], "text"),                        GetSQLValueString($row_products['productID'], "int"),                        GetSQLValueString($row_products['default_price'], "int"),                        GetSQLValueString($row_products['default_quantity'], "int"));   mysql_select_db($database_ppl_frontend, $ppl_frontend);   $Result1 = mysql_query($insertSQL, $ppl_frontend) or die(mysql_error()); } ?> <?php } while ($row_products = mysql_fetch_assoc($products)); ?> <?php if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "add_user")) {   $insertSQL = sprintf("INSERT INTO ppl_users (username, password, access, email, real_name, company, post_add1, post_add2, post_add_sub, post_add_city, ship_add1, ship_add2, ship_add_sub, ship_add_city) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",                        GetSQLValueString($_POST['username'], "text"),                        GetSQLValueString($_POST['password'], "text"),                        GetSQLValueString($_POST['access'], "text"),                        GetSQLValueString($_POST['email'], "text"),                        GetSQLValueString($_POST['real_name'], "text"),                        GetSQLValueString($_POST['company'], "text"),                        GetSQLValueString($_POST['post_add1'], "text"),                        GetSQLValueString($_POST['post_add2'], "text"),                        GetSQLValueString($_POST['post_add_sub'], "text"),                        GetSQLValueString($_POST['post_add_city'], "text"),                        GetSQLValueString($_POST['ship_add1'], "text"),                        GetSQLValueString($_POST['ship_add2'], "text"),                        GetSQLValueString($_POST['ship_add_sub'], "text"),                        GetSQLValueString($_POST['ship_add_city'], "text"));   mysql_select_db($database_ppl_frontend, $ppl_frontend);   $Result1 = mysql_query($insertSQL, $ppl_frontend) or die(mysql_error());   $insertGoTo = "users.php";   if (isset($_SERVER['QUERY_STRING'])) {     $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";     $insertGoTo .= $_SERVER['QUERY_STRING'];   }   header(sprintf("Location: %s", $insertGoTo)); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>etc etc etc[/code]
  13. [code]<?php echo date("jS M Y",strtotime($row_orders['order_date'])); ?>[/code] Does anyone know why this is returning the date 1st Jan 1970 no matter what is in the Database? I just copied/pasted this code from another website I did a while ago that works fine. Values in the DB are stored using TIMESTAMP in MySQL
  14. Is it possible to echo a specific record in a MySQL table based on its ID column?
  15. Try changing: $headers .= 'From: me <me@bt.com>' . "\r\n"; To: $headers = 'From: me <me@bt.com>' . "\r\n";
  16. [!--quoteo(post=364372:date=Apr 14 2006, 12:38 AM:name=caraldur)--][div class=\'quotetop\']QUOTE(caraldur @ Apr 14 2006, 12:38 AM) [snapback]364372[/snapback][/div][div class=\'quotemain\'][!--quotec--] Could you post your code so we can have a look at it? [/quote] Full PHP File avalible here: [a href=\"http://www.adamjobbins.com/code/process_order.zip\" target=\"_blank\"]http://www.adamjobbins.com/code/process_order.zip[/a] [code]<?php mysql_select_db($database_ppl_frontend, $ppl_frontend); $query_admin = "SELECT * FROM ppl_admin"; $admin = mysql_query($query_admin, $ppl_frontend) or die(mysql_error()); $row_admin = mysql_fetch_assoc($admin); $totalRows_admin = mysql_num_rows($admin); mysql_select_db($database_ppl_frontend, $ppl_frontend); $query_products = "SELECT * FROM ppl_products"; $products = mysql_query($query_products, $ppl_frontend) or die(mysql_error()); $row_products = mysql_fetch_assoc($products); $totalRows_products = mysql_num_rows($products); mysql_select_db($database_ppl_frontend, $ppl_frontend); $query_orders = "SELECT * FROM ppl_orders ORDER BY orderID DESC"; $orders = mysql_query($query_orders, $ppl_frontend) or die(mysql_error()); $row_orders = mysql_fetch_assoc($orders); $totalRows_orders = mysql_num_rows($orders); ?>    <?php   function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")  { ?>   <?php do {   $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;    $product = $row_products['productID']; $product_qty0 = "qty" . $product; $product_qty = $_POST[$product_qty0]; $product_total0 = "total" . $product; $product_total = $_POST[$product_total0];   switch ($theType) {     case "text":       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";       break;         case "long":     case "int":       $theValue = ($theValue != "") ? intval($theValue) : "NULL";       break;     case "double":       $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";       break;     case "date":       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";       break;     case "defined":       $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;       break;   }   return $theValue; } $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) {   $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "Order")) {   $insertSQL = sprintf("INSERT INTO ppl_order_products (orderID, productID, product_quantity, product_total) VALUES (%s, %s, %s, %s)",                        GetSQLValueString($_POST['orderID'], "int"),                        GetSQLValueString($product, "int"),                        GetSQLValueString($product_qty, "int"),                        GetSQLValueString($product_total, "int"));   mysql_select_db($database_ppl_frontend, $ppl_frontend);   $Result1 = mysql_query($insertSQL, $ppl_frontend) or die(mysql_error()); } } while ($row_products = mysql_fetch_assoc($products)); ?> <?php } ?>[/code]
  17. have a look here [a href=\"http://www.indigostar.com/microweb.htm\" target=\"_blank\"]http://www.indigostar.com/microweb.htm[/a] Its a really great web server, comes with PHP already installed and configured. I run mine off my flash drive, totally portable and really great to show work off to clients when a connection to the net isn't possible
  18. Can you please post your code (just the mail part) Also, is your server a UNIX server?
  19. I have been doing some extensive googling and have found some references to using a do...while approach to this, which is what I have been trying to do. I would really appreciate some help on this.
  20. [!--quoteo(post=364269:date=Apr 13 2006, 02:39 PM:name=dcgamers)--][div class=\'quotetop\']QUOTE(dcgamers @ Apr 13 2006, 02:39 PM) [snapback]364269[/snapback][/div][div class=\'quotemain\'][!--quotec--] Thanks it worked. Hey I'm a c++ guy not a php guy :). I have one more question and it is about Mysql_query and displaying in a loop, the contents of a database table. I need to know how to be able to click on a link in the loop (per looped item that is) and make it take me to a page where there will be more data for that specific item. Sorry this may be confusing, I don't know the right term names. [/quote] Just use a one row table and echo the values from your query you want, but before the able put this line of code: [code]<?php do { ?>[/code] And after the table put the code: [code]<?php } while ($row_NAME-OF-QUERY = mysql_fetch_assoc($NAME-OF-QUERY )); ?>[/code] In the table put a link to another page something like this: [code]<a href="otherpage.php?ID=<?php echo $row_NAME-OF-QUERY['IDFEILD'];?>">More Info</a>[/code] On your second page make a query that is filtered by the URL Paramater ID and use the ID feild Hope that all makes sense, not good at explaining
  21. Hey, I am doing an customer order site up and I am trying to store the order details in a MySQL Database. I am doing the site in dreamweaver. I have a table called 'Orders' which stores the order number and the total and date and a table called 'Order_Products' which stores the details of the products on the orders. It has an orderID feild which matches the details with the record in the 'Orders' table. What I am struggling with is getting it to store the details of each line of the order. I can get it to store the first line fine. I tried using the code from dreamweavers 'Repeat Reigion' featute but all I am getting is error messages. Am I going about this the right way? I have posted a copy of the PHP file so you can have a look at my code at: [a href=\"http://www.adamjobbins.com/code/process_order.zip\" target=\"_blank\"]http://www.adamjobbins.com/code/process_order.zip[/a]
  22. [code]$product_qty = ("qty" .$row_products['productID'])[/code] I am trying to set the variable $product_qty to "qty[productID]" where [productID] is the ID from the current row. E.G. If the ID of the current row was 1 then $product_qty = qty1 I don't know how to code this and so am only guessing. I am getting the following error: [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Parse error: parse error, unexpected T_VARIABLE in .../public_html/testsite/profile/site/process_order.php on line 70 [/quote] Is someone please able to help me out with the correct code? This would be much appreciated.
  23. [!--quoteo(post=363305:date=Apr 11 2006, 02:59 AM:name=kenrbnsn)--][div class=\'quotetop\']QUOTE(kenrbnsn @ Apr 11 2006, 02:59 AM) [snapback]363305[/snapback][/div][div class=\'quotemain\'][!--quotec--] Can you post the code as it exists now? Ken [/quote] Thanks but I have worked it out now
×
×
  • 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.