I have a problem with mySQL
Consider I have a table with a column named member_functions.
One record = 10233435
In the table functions, I gave every record a number from 10 to 40 so in the record I need everytime 2 characters to compare with my table functions to get the propre functions for that member.
example: 10233435 = function 10 + function 23 + function 34 + function 35
that's never been a problem to get that, but I want to order my records by the first 2 characters of every record: this is what I have :
4 $result = mysql_query("select * from members order by substr(member_functions,2) asc");
5 while($myrow = mysql_fetch_array($result))
6 {
7 echo("<table width='360' border='0' cellspacing='0' cellpadding='0'>
.....
and this is the error:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in
/backup/home/kevv3/public_html/gezinsbond/bestuur.php on line 5
I allready figured out that it has to do something with the order by substr(...)
can someone plss help me, it's urgent
Consider I have a table with a column named member_functions.
One record = 10233435
In the table functions, I gave every record a number from 10 to 40 so in the record I need everytime 2 characters to compare with my table functions to get the propre functions for that member.
example: 10233435 = function 10 + function 23 + function 34 + function 35
that's never been a problem to get that, but I want to order my records by the first 2 characters of every record: this is what I have :
4 $result = mysql_query("select * from members order by substr(member_functions,2) asc");
5 while($myrow = mysql_fetch_array($result))
6 {
7 echo("<table width='360' border='0' cellspacing='0' cellpadding='0'>
.....
and this is the error:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in
/backup/home/kevv3/public_html/gezinsbond/bestuur.php on line 5
I allready figured out that it has to do something with the order by substr(...)
can someone plss help me, it's urgent