|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
|
|
#1
|
|||
|
|||
|
Trouble with Matt's Column Sorting Tutorial
I am getting the following error when using the tutorial example that Matt provided on how to sort a retrieved table by column headings:
Fatal error: Call to undefined function: mysql_fetch_assoc() Other functions, such as mysql_fetch_array() work. Is this a version problem, or am I missing something? Thanks, Rich |
|
#2
|
|||
|
|||
|
RE: Trouble with Matt's Column Sorting Tutorial
mysql_fetch_assoc was introduced in 4.0.3....
|
|
#3
|
|||||
|
|||||
|
RE: Trouble with Matt's Column Sorting Tutorial
I am working this same issue and have a similar problem. My database is called custinfo and the table involved is custcont.
Output from DESC custcont is: +----------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +----------+--------------+------+-----+---------+----------------+ | id | int(11) | | PRI | NULL | auto_increment | | datecon | date | YES | | NULL | | | ieipoc | varchar(25) | YES | | NULL | | | custpoc | varchar(50) | YES | | NULL | | | custname | varchar(25) | YES | | NULL | | | subject | varchar(50) | YES | | NULL | | | comment | varchar(250) | YES | | NULL | | +----------+--------------+------+-----+---------+----------------+ 7 rows in set (0.15 sec) My code: php Code:
Output from this page is WEIRD: IEI Face to Face Contact Database IEI Customer Contact Database n n idn dateconn ieipocn custpocn custnamen subjectn commentn n n $columnn $columnn $columnn $columnn $columnn $columnn $columnn n n Input New Record Search For Record Copyright (c) 2003 by International Enterprises, Inc. All rights reserved Anyone have a clue to loan as to why the actual data is not displayed? Thanks rk |
|
#4
|
|||
|
|||
|
RE: Trouble with Matt's Column Sorting Tutorial
Try changing this line
'<TD>$column</TD>n'; so it would look like this: '<TD>'.$column'.</TD>n'; |
|
#5
|
|||
|
|||
|
RE: Trouble with Matt's Column Sorting Tutorial
Doh! That fixed it. I looked and looked and looked at the code and didn;t see that I had the variable within the ticks....ah well, thanks for the pointer!
On another issue with this code, HOW can I change the column name display? Instead of 'datecon', I would prefer 'Date of Contact'? Also, can I prevent certain columns from being displayed at all? Would this be done from within the select statement? TIA rk |
|
#6
|
|||
|
|||
|
RE: Trouble with Matt's Column Sorting Tutorial
Glad that helped. As far as column names, set them in the Select statement, like this:
$query = ("SELECT M.Firm, L.abrev Local, M.memberType Type, M.Name, M.Street, M.City, M.State, M.Zip, M.Phone, M.Ext, M.Fax, M.Email, M.WebURL"); $query .= (" FROM Member M, LocalAssn L"); $query .= (" WHERE M.LocalAssn_id=L.assn_id"); For instance, the word Local is substituted for the L.abrev column name in the results. Rich |
|
#7
|
|||
|
|||
|
RE: Trouble with Matt's Column Sorting Tutorial
If it is in the select statement, it will print, so change your select statement from * (all) to the explicit columns you want returned, as in the previous post example.
Rich |
![]() |
| Viewing: Codewalkers Forums > Other > Tutorials > Trouble with Matt's Column Sorting Tutorial |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|
|