Forum: PHP Nov 13th, 2008 |
| Replies: 11 Views: 3,122 it is giving you the highest id in that table, when you do the insert use
select LAST_INSERT_ID();
this will give you the id of that row, not the highest one in the table |
Forum: PHP Nov 13th, 2008 |
| Replies: 11 Views: 3,122 you can do it that way, i would suggest returning a value from a stored procedure like
select LAST_INSERT_ID(); |
Forum: PHP Oct 29th, 2008 |
| Replies: 2 Views: 399 And just as good practice, a database is there for the organization, it doesn't need to be in sequential order.
It may look prettier to you if it is, but just add an order by user_id or whatever... |
Forum: PHP Oct 29th, 2008 |
| Replies: 2 Views: 399 i don't have a clear idea of what you are wanting
the message_from field has a 3 and it needs to be a 104? |
Forum: PHP Oct 28th, 2008 |
| Replies: 18 Views: 1,058 That is the point of the query, you are able to distinguish in the same resultset of who are chaplains and not. You want to use the same column and distinguish code side by checking user_level. |
Forum: PHP Oct 28th, 2008 |
| Replies: 18 Views: 1,058 thats because you are assigning it, the is_chaplain column didn't exist and we had to give it values, the user level column does exist
use this in both queries and you will get your 2 or 3
... |
Forum: PHP Oct 28th, 2008 |
| Replies: 18 Views: 1,058 yes, i thought you meant you didn't have a way to distinguish
instead of the is_chaplain, substitute the user_level into the query |
Forum: PHP Oct 28th, 2008 |
| Replies: 18 Views: 1,058 i think we need to add single quotes around the is_chaplain
//readers
0 as 'is_chaplain'
//chaplains
1 as 'is_chaplain' |
Forum: PHP Oct 28th, 2008 |
| Replies: 18 Views: 1,058 SELECT assignment.Id, assignment.Candidate, assignment.`Section`, assignment.Team, assignment.Chaplain, assignment.Reader, tbl_user.Id, CONCAT_WS(' ', `tbl_user`.name_pre, `tbl_user`.name_first,... |
Forum: PHP Oct 28th, 2008 |
| Replies: 18 Views: 1,058 If you need the results separated, then why not issue 2 queries?
Or add an additional column to the rows for the union,
for readers 0 as IS_CHAPLAIN
for chaplains 1 as IS_CHAPLAIN |
Forum: PHP Oct 28th, 2008 |
| Replies: 18 Views: 1,058 i don't get what the difference is in the concat of the chaplain, you are using the same columns
can you show what the concat difference is? |
Forum: PHP Oct 28th, 2008 |
| Replies: 18 Views: 1,058 f_name field is just pre + first + last + suffix
it will use the same formatting for both readers and chaplains
if you want this field different, please explain more clearly with an example of... |
Forum: PHP Oct 28th, 2008 |
| Replies: 18 Views: 1,058 WHERE tbl_user.Id= assignment.Reader OR tbl_user.Id = assignment.Chaplain
i think this is what you are looking for with the additional where |
Forum: PHP Aug 25th, 2008 |
| Replies: 4 Views: 562 A good way would be to include the parameters in the query string
<a href="www.thispage.com?county=Chaffee&state=Colorado"> Chaffee </a> |