Forum: MySQL Apr 7th, 2009 |
| Replies: 5 Views: 738 also try this statement also
select * FROM assign2 WHERE UPPER(CONVERT(keyword1 USING latin1)) LIKE '%MICROSOFT%'; |
Forum: MySQL Apr 7th, 2009 |
| Replies: 5 Views: 738 What type of collation is this?
run this
SHOW FULL COLUMNS FROM assign2; |
Forum: MySQL Mar 10th, 2009 |
| Replies: 2 Views: 404 this doesn't have error handling, but here is how you do it following your line
$result = $mysqli->query($queryStr);
$row_count = $result->num_rows;
$result->close(); |
Forum: MySQL Mar 4th, 2009 |
| Replies: 17 Views: 1,437 look at my previous post with a subquery just for you javamedia :-)
i'm not against them at all, just meaning don't shy away from the joins, get a understanding of them and use them in combination... |
Forum: MySQL Mar 4th, 2009 |
| Replies: 17 Views: 1,437 sorry bout that, was a late night and didn't think twice about it
this will work
select
(select count(*) from posts p1 where p1.user_id = u.user_id) as post_count,
u.user_id
from users u... |
Forum: MySQL Mar 3rd, 2009 |
| Replies: 17 Views: 1,437 you are trying to do an inner join on something that isn't there, all users don't have posts
unlike javamedia, i would suggest trying to use inner or outer joins, at least to me it makes life much... |
Forum: MySQL Dec 1st, 2008 |
| Replies: 3 Views: 961 lol easiest way to explain it is be specific
from table1, table2 join table3 on id = table3.id
who knows what that means
now this |
Forum: MySQL Dec 1st, 2008 |
| Replies: 3 Views: 961 here i found an article on the suggestion i gave you earlier
its because order of precedence, also always try to do joins this way, makes much cleaner code
... |
Forum: MySQL Nov 25th, 2008 |
| Replies: 71 Views: 3,440 sure thing man, finally got up to veteran poster now along the way :-)
glad it all works for you, and i'm sure you understand relational databases much better
TORONTO here i come!!! |
Forum: MySQL Nov 25th, 2008 |
| Replies: 71 Views: 3,440 actually no need to check the uas table at all, just delete, then insert
you are correct, check user table i guess from a login or whatever that is, then no need to check anything against uas... |
Forum: MySQL Nov 25th, 2008 |
| Replies: 71 Views: 3,440 no need to do a check, just run the delete, it won't matter if there is a match or isn't
then just run inserts |
Forum: MySQL Nov 25th, 2008 |
| Replies: 71 Views: 3,440 constraints will do what you are meaning, delete from the user table then it will propagate to other tables that reference that user
lol did i put delete *, just use delete from without the * |
Forum: MySQL Nov 25th, 2008 |
| Replies: 71 Views: 3,440 well it doesn't make sense as far as the user won't have any services, from the database side it just means there is a user, just no services saved yet
yes users -> uas 1..x
it means a user has... |
Forum: MySQL Nov 25th, 2008 |
| Replies: 71 Views: 3,440 should be the opposite, user_id can't exist in the uas table without being in the user_table
delete from the uas table only, not user table
try to run the command without php and see if you get... |
Forum: MySQL Nov 25th, 2008 |
| Replies: 71 Views: 3,440 noooo, not the user table
this is what i was meaning, i think you are using $u_id
delete * from useraccessservices where user_id = $u_id
maintain the user table, how do you get to the... |
Forum: MySQL Nov 25th, 2008 |
| Replies: 71 Views: 3,440 ahhhh, well we have no deletes here
i don't really like this option, but would you want to delete all the rows for that user_id prior to doing updates and inserts?
(edit: stupid me, there... |
Forum: MySQL Nov 24th, 2008 |
| Replies: 71 Views: 3,440 print the query right before its executed once values are subbed in, need to see what is happening here |
Forum: MySQL Nov 24th, 2008 |
| Replies: 71 Views: 3,440 there will be an entry in the array for each service for that user, the part i'm not sure about is how are you having duplicate id's?
40
40
40?
42
42
42? |
Forum: MySQL Nov 24th, 2008 |
| Replies: 71 Views: 3,440 you can also use mysql_num_rows to the same effect
http://us.php.net/mysql_num_rows |
Forum: MySQL Nov 24th, 2008 |
| Replies: 71 Views: 3,440 thats it man
the reason why you have to query all three for the uas, is because user_id has multiple airports and multiple services for each, without a uas_id then you need to query against all... |
Forum: MySQL Nov 24th, 2008 |
| Replies: 71 Views: 3,440 sorry about that, all you need to do see if there is a result or not
here's a link if you are ever interested
http://pear.activeventure.com/package/package.database.db.db-common.getone.html |
Forum: MySQL Nov 24th, 2008 |
| Replies: 71 Views: 3,440 you sure you mean $aid instead of $a_id
also your update statement needs to be based on uas_id, otherwise , you will have multiple rows for each user in the update |
Forum: MySQL Nov 24th, 2008 |
| Replies: 71 Views: 3,440 see this database stuff isn't so hard now is it :-) |
Forum: MySQL Nov 24th, 2008 |
| Replies: 71 Views: 3,440 Correct, if you delete an airport or service then all records that reference that airport or service needs to be deleted as well
deletes on those CAN only happen in the primary tables(airport,... |
Forum: MySQL Nov 24th, 2008 |
| Replies: 71 Views: 3,440 the uas should allow deletes, inserts, and updates with no cascading, if you think of it, this is a bottom level table, no tables depend upon it, it depends upon other tables
if user_id gets... |
Forum: MySQL Nov 24th, 2008 |
| Replies: 71 Views: 3,440 also what you could do which would probably be a better solution, just maybe more time consuming, is to create a hidden field that goes with each checkbox that stores the user_airport_services_id, if... |
Forum: MySQL Nov 24th, 2008 |
| Replies: 71 Views: 3,440 lol whoaaa now
might have to come for toronto, can never turn down a free beer
you almost got it, what you can do is for each checkbox value, query the table, if exists, do an update, if not,... |
Forum: MySQL Nov 23rd, 2008 |
| Replies: 71 Views: 3,440 yes, except the left join on user_id
the where clause is limiting the results to only ones that exist, if the change doesn't show the results properly, then let me know, and it can be modified |
Forum: MySQL Nov 23rd, 2008 |
| Replies: 71 Views: 3,440 reverse the statement and use a left
select ....
from airports
left join user_airport_services
on .... |
Forum: MySQL Nov 23rd, 2008 |
| Replies: 71 Views: 3,440 i don't have a mysql database in front of me right now, but trying changing that statement i gave you, to a right join instead of inner |
Forum: MySQL Nov 23rd, 2008 |
| Replies: 2 Views: 761 select DATEDIFF(now(), '2008-12-25) |
Forum: MySQL Nov 23rd, 2008 |
| Replies: 71 Views: 3,440 you need to specify inner join on (columnname)
maybe i just don't get it, lol but i cannot understand what you are trying to do here |
Forum: MySQL Nov 22nd, 2008 |
| Replies: 71 Views: 3,440 not quite sure what you are meaning, show me what you want your result set to be and what your current query is |
Forum: MySQL Nov 20th, 2008 |
| Replies: 71 Views: 3,440 basically there will be rows, that will be null (its set to 0 in the the if statement), because the rows are columns, if the service_id != 1 then the row will be null
therefore, the max will pull... |
Forum: MySQL Nov 20th, 2008 |
| Replies: 71 Views: 3,440 this should do the trick, the only problem is if you ever add services, you will need to change the query to reflect that
select usr_id_users as USR_ID, airport_id_airport AS AIRPORT_ID,... |
Forum: MySQL Nov 19th, 2008 |
| Replies: 71 Views: 3,440 sure man, will work on it right after i get to work in the morning
...ahhhh, a fresh mind |
Forum: MySQL Nov 19th, 2008 |
| Replies: 71 Views: 3,440 thanks, how soon do you need it?
cool if i get back with you in the morning? |
Forum: MySQL Nov 19th, 2008 |
| Replies: 71 Views: 3,440 the table schema, if you want you can send a backup if its small enough |
Forum: MySQL Nov 19th, 2008 |
| Replies: 71 Views: 3,440 will you post the structure and i get you a query? |
Forum: MySQL Nov 19th, 2008 |
| Replies: 71 Views: 3,440 just to be sure this is what you are meaning, here's a similar post
http://www.daniweb.com/forums/post735371-9.html
is this what you want? |