Search Results

Showing results 1 to 40 of 78
Search took 0.01 seconds.
Search: Posts Made By: dickersonka ; Forum: MySQL and child forums
Forum: MySQL Apr 7th, 2009
Replies: 5
Views: 738
Posted By dickersonka
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
Posted By dickersonka
What type of collation is this?

run this


SHOW FULL COLUMNS FROM assign2;
Forum: MySQL Mar 10th, 2009
Replies: 2
Solved: MySQLI
Views: 404
Posted By dickersonka
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
Posted By dickersonka
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
Posted By dickersonka
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
Posted By dickersonka
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
Posted By dickersonka
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
Posted By dickersonka
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
Posted By dickersonka
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
Posted By dickersonka
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
Posted By dickersonka
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
Posted By dickersonka
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
Posted By dickersonka
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
Posted By dickersonka
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
Posted By dickersonka
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
Posted By dickersonka
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
Posted By dickersonka
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
Posted By dickersonka
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
Posted By dickersonka
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
Posted By dickersonka
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
Posted By dickersonka
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
Posted By dickersonka
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
Posted By dickersonka
Forum: MySQL Nov 24th, 2008
Replies: 71
Views: 3,440
Posted By dickersonka
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
Posted By dickersonka
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
Posted By dickersonka
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
Posted By dickersonka
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
Posted By dickersonka
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
Posted By dickersonka
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
Posted By dickersonka
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
Posted By dickersonka
select DATEDIFF(now(), '2008-12-25)
Forum: MySQL Nov 23rd, 2008
Replies: 71
Views: 3,440
Posted By dickersonka
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
Posted By dickersonka
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
Posted By dickersonka
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
Posted By dickersonka
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
Posted By dickersonka
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
Posted By dickersonka
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
Posted By dickersonka
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
Posted By dickersonka
Forum: MySQL Nov 19th, 2008
Replies: 71
Views: 3,440
Posted By dickersonka
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?
Showing results 1 to 40 of 78

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC