-
Posts
3,372 -
Joined
-
Last visited
-
Days Won
18
Everything posted by Muddy_Funster
-
not that lol. but I have noticed something. Try this: SELECT wp_bp_groups.name, wp_bp_xprofile_data.value FROM wp_bp_groups.name RIGHT JOIN wp_bp_xprofile_data ON (wp_bp_groups.id = wp_bp_xprofile_data.user_id)
-
Just had a thought, if the $intItemID is taken from the "current page" are you trying to use $_POST to get a value from the page header?
-
just out of curiosity, what happens when you run your SELECT wp_bp_groups.name, GROUP_CONCAT( wp_bp_xprofile_data.value SEPARATOR ',' ) FROM wp_bp_xprofile_data, wp_bp_groups_members, wp_bp_groups WHERE wp_bp_groups.id = wp_bp_groups_members.id AND wp_bp_groups_members.id = wp_bp_xprofile_data.id with the last = wp_bp_xprofile_data.id changed to = wp_bp_xprofile_data.user_id instead?
-
how about declaring the database in the query.....give this a try SELECT wp_bp_groups.name, wp_xprofile_data.value FROM wp_bp_groups RIGHT JOIN wp_xprofile_data ON ([your databse name].wp_bp_groups.id = [your database name].wp_xprofile_data.user_id) Without the square brackets
-
That's because there is only the one record that matches on the wp_xprofile table under the id field. You will need to link to the user_id field, and I think that's the problem with the statement I gave you - user_id is what mySQL calls it's own user ID field, and it may be getting mixed up :/ can you rename the field to uid or something similar?
-
still not getting this %d thing at all, and we obviously have different deffinitions of "working fine". However, give this code a try if you havn't already. INSERT INTO messages (firstname, message, intItemID) VALUES ('$name', '$message', $intItemID)"
-
bah! my bad, remove the .name from "wb_bp_groups.name" after the FROM >_<
-
Working purely from the information you have posted, you are grossly over complicating things. All you should need is SELECT wp_bp_groups.name, wp_xprofile_data.value FROM wp_bp_groups.name RIGHT JOIN wp_xprofile_data ON (wp_bp_groups.id = wp_xprofile_data.user_id)
-
100% agree. Try and query your table using LIKE and I bet you get your results (...WHERE name LIKE '%Aabrha%')
-
1. Do you have a REALLY good reason for using SELECT *? 2. What is %d ? it's not a number, so should be wraped in quotes regardless. It also includes a wildcard for use with the LIKE statement which, obviously, is different from [=]. Could you tell us what %d is reffering to exactly.
-
this is un-tested, but should give the ground work for you to get a working query: SELECT Users.username, Products.name, Products.price, Sales.time FROM Users INNER JOIN Sales ON ( Users.user_id = Sales.sales_id) Products INNER JOIN Sales ON (Products.product_id = Sales.product_id) WHERE Users.user_id = [your variable here] ORDER BY Sales.time DESC LIMIT 1
-
Your issue here is the multiple ORDER BY statements. It should read "ORDER BY date ASC, Cost ASC".
-
maybe mark as solved then?.....
-
what is in $order1 and $order2? could you echo $qry_str before you run it and post what it contains at the point where it would be sent to the database?
-
I would give serious considerastion to revising your SQL. Somthing like this would make more sense: SELECT id FROM people INNER JOIN ratings ON (people.id = ratings.rater_id) WHERE ratings.event_id = '$eventid' AND ratings.complete = 'n'
-
Wouldn't it be a whole lot easier (and better practice) just to have an ID field in the database table that you can then use to index the records?
-
so youre looking for something like SELECT SUM (inventoryTable.weight * AmountLeft.qnty) FROM AmountLeft INNER JOIN inventoryTable ON (amountLeft.Item = inventoryTable.Item) WHERE USER ID = <some id number> Not that I think that will work, but does it look like what you want to do? Could you also provide the full tables, as knowing all the filds and their relations makes things easier than just knowing what is apparently relevant.
-
Transaction commits but then SELECT statement fails
Muddy_Funster replied to TheFilmGod's topic in MySQL Help
any chance of some code to work with? -
Once the problem with the PHP is sorted, your then going to get a problem with the actual SQL aswell....Unless everything that you are entering into the database is a number. @Pikachu - Loving that cartoon in your sig!
-
Addressing the code highlighted by mikosiko should get your query to run. Just a note on your join though: right and left joins are used for one to many / many to one relationships, inner and natural joins are used for one to one relationships.
-
While looped insert is not working as expected. No errors.
Muddy_Funster replied to OldWest's topic in PHP Coding Help
You're not seriously including the auto inc field in your insert statement are you?...'cause that would just be silly... -
For the first part you are simply looking for a COUNT(SELECT venue FROM <table> WHERE venue = 'new york'). The second part isn't something that I know a database can do (not without having some control fields included in the table). Maybe it can, but I think you're going to be looking ar some fairly complex array work in php to get the output that you are looking for. Regardless, I'm sorry to say I can't help any more than that.
-
Could you please post a dump of your table structures?
-
syntax error, trying to add page link, How to recode
Muddy_Funster replied to wayland's topic in PHP Coding Help
What exactly is the error? What is $_['0']? And is $config an array? -
try this: FROM ps_orders AS O INNER JOIN ps_customer AS C ON (O.id_customer = C.id_customer) INNER JOIN ps_address AS AD ON (O.id_address_delivery = AD.id_address AND O.id_address_invoice = AD.id_address_invoice), ps_order_detail AS OD, ps_manufacturer AS M