For the life of me I cannot seem to sort out what I am doing wrong here.
My firefox error console reports that signup is not a function :
The script is in the header.
<script language="JavaScript">
function signup(){
alert("Hello");
};
</script>
<form name="signup">...
mbrooks:
$urow->{userid} does contain the desired result. I don't think it would be the cause of this error anyway.
MikeLacey:
The printout is just what I intent to send as an sql statement.
I have tried your code and it still gives me an error:
Use of uninitialized value in concatenation (.) or string at email_prefs.pl line 16.
Line 16 is the line where the prepare statement is.
Is there a problem with the tablename.fieldname naming in the SQL. Does Perl see this as a...
I am trying to execute a mysql query-
$sql = "SELECT S.supplier, S.sup_img, C.prodid, D.product, D.catid, C.minprice
FROM suppliers S
INNER JOIN (SELECT B.supplierid, A.prodid, A.minprice
FROM sup_prices B
INNER JOIN (SELECT X.prodid, MIN(X.price_each) minprice
FROM sup_prices X
INNER...
I will start off by posting my SQL code first-
SELECT X.prodid, Y.product, X.supplierid, MIN( X.price_each ) AS minprice
FROM sup_prices X
INNER JOIN (
SELECT PP.prodid, PP.product
FROM products PP
INNER JOIN prefs PR ON PP.catid = PR.catid
AND PP.prodid = PR.pref
WHERE userid =1
)Y...
PVH Your a legend!!
Query took 0.0785 sec.
Cheers.
What a difference it makes to have added those extra inner joins.
Now I have to figure out why it works so well in place of the other queries.
Sorry it was my fault that the product LIKE '%%%' was included in the supplied query. I could not edit it after I submitted the post.
I am also aware that this filter will have overheads on the query so I have removed it from my main query. Not much difference in performance.
Golom earlier...
I have 8 suppliers, 328 products totalling 2625 records in the sup_prices table.
Tried the sub query by it's self and no probs. But the query as a whole still takes around 35 sec.
I am not using any indexing at the moment as I am unsure where to apply the indexing.
Do you have any experience...
-- Sorry some mistakes in the last post -- (I cannot edit it after posting)
I tried your query against the database and not really and difference in speed.
Is there another way of speeding this query up such as indexing some fields or to change the table structure from -
PRODUCTS table
|...
I tried your query against the database and not really and difference in speed.
Is there another way of speeding this query up such as indexing some fields or to change the table structure from -
PRODUCTS table
| prodid | catid | product |
------
SUP_PRICES table
| prodid | catid |...
Thanks for your replys guys
I have taken your suggestions and developed this expression
SELECT supplier,product,price_each as price, sup_prices.prodid as prodid
FROM products, sup_prices, suppliers
WHERE (sup_prices.prodid,price_each)
IN (SELECT sup_prices.prodid, min(price_each)
FROM...
I have a table structured as such:
customerid, productid, price
I would like to extract the minimum price for each product and which supplier it is.
this is my code so far:
SELECT supplierid, productid, min(price) FROM `sup_prices` group by price order by productid
This gives me all the...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.