Forum Moderators: mack
First, sorry if this not the appropriate forum to post my message, but... here it goes:
I have a MySQL database with +/- 2000 records. Each one has fields like: CompanyName, Address, Cyty, Phone, and so on...
Most of them are 'normal' records. They are listed in the webpage for free, they didn't paied anything to be there and appear on my website.
But (1) some of them, had paied a certain amount ($xx), to be more visible. That is, instead of appearing normally in the list as all the others, their information record appears inside a nice framme border with nice colors and with some nice words in the top like "registered company".
But (2) some of them had paied a certain amount ($#*$!), to be more, more visible. That is, instead of appearing normally in the list as all the others, their information record appears at the top of the list (independent of the sorted order) with a nice framme border with nice colors and with some nice words in the top like "gold registered company".
I know that (maybe?) the webpage with the list can be generated/filled with PHP reading the database. But for me this is ease if all records appears the same way.
Is there some way I can make this also with PHP, so that the "registered companies" appears intercalated inside the list with the nice border and that the "gold registered company", appears at the top of the list?
The list is alphabetically sorted.
"registered companies" and "gold registered company", can be a y/n field of the database.
Example:
+++++GOLD R.C.++++++++++++++
+ CB companyname ..........+
+ Address - City - Phone ..+
++++++++++++++++++++++++++++
A companyname
Address - City - Phone
B companyname
Address - City - Phone
----------------------------
¦ CA companyname ..........¦
¦ Address - City - Phone ..¦
----------------------------
CD companyname
Address - City - Phone
----------------------------
¦ CE companyname ..........¦
¦ Address - City - Phone ..¦
----------------------------
D companyname
Address - City - Phone
......
and so on...
In same order of ideias, it's more or less want happens with the results of a G search?!
Thanks in advance by some help, best regards,
PSAZF
(Portugal)
As for how you layout the html to diplay this the way you want, you may have to play with it for a bit.
Hope this helps!
...sort by the sort order...
this is not what I need, because I need that the records "2 for paid" appears sorted with the records "3 for all the rest". Look my example in my 1st post.
Sorry, what you mean with "algos"?
You think it's a big problem layout the html to diplay this the way you want?
Somemore opinions?
Regards,
PSAZF
Image that I have the following table sorted by companyname:
CompanyName ... Address ... PaymentType
----------------------------------------
Aaaaaaaaaaa ... xyxyxyx ... none 3
Bbbbbbbbbbb ... nbnbnbn ... none 3
CAaaaaaaaaa ... ghghghg ... paid 2
CBbbbbbbbbb ... tetetet ... Gold 1
CDddddddddd ... ksksksk ... none 3
CEeeeeeeeee ... quququq ... paid 2
Ddddddddddd ... rororor ... none 3
Eeeeeeeeeee ... spspsps ... Gold 1
I need that all company names appears in the webpage, listed/sorted by CompanyName, when PaymentType is 3 and/or 2. But when it's 2, the space where the info for this company appears, must be bordered by some type of frame/graphics (not html frame), to become more eyes catch.
If PaymentType is Gold (1), this/that company(ies) need to be listed on the top (before all the 3 and 2 type) with the space where the info for this company appears, be bordered by some type of frame/graphics, different from the border of 2 and 3 types, to become even more eyes catch, to be the first to be seen.
Example, using data from example table above:
+++++GOLD+++++++++
+ CBbbbbbbbbb..........+
++++++++++++++++++
+++++GOLD+++++++++
+ Eeeeeeeeeee..........+
++++++++++++++++++
Aaaaaaaaaaa
Bbbbbbbbbbb
-----------------------
¦ CAaaaaaaaaa ..........¦
-----------------------
CDddddddddd
-----------------------
¦ CEeeeeeeeee ..........¦
-----------------------
Ddddddddddd
------------------------------------
Now it's more clear? Can you see if php can deal with this?
Best regards and thanks in advance
PSAZF
(Portugal)
and for each record found, echo $companyname in gold box and pretty colours
Then...
SQL select all records where paid <> Gold & Sort by company name
And for each record found...
If current payment type = Paid then echo $companyname in nice colours
If current payment type = none then echo $companyname without colours
Hope this helps
Yes, I had this idea for resolve this kind of problem, but what i didn't am sure, was if PHP mixed with Html and Mysql, can deal with it.
I already made some websites, but all have static pages. I'm learning now the beginnings of php and mysql, for my new website, that must deal with databases data.
Thanks and kind regards
PSAZF