Ik ben bezig met een mp3 site en nu wil ik dat ie vanuit een chart een nummer gaat zoeken in m'n database. Maar hij moet op 2 manieren zoeken. Manier 1 is dat ie precies matched met de song uit de database, dus artiest en song zijn precies gelijk. Die resultaten moet ie in een tabel zetten. En manier 2 gewoon dat toevallig t nummer hetzelfde heet, of de artiest is hetzelfde, of het lijkt er gewoon op.
Nu heb ik het volgende geschreven
behoorlijk stuk ja...
Maar nu krijg ik helemaal geen resultaten met 100% of niet
Bijvoorbeeld dit:
http://www.mp3-drug.com/projectz/download?a=Kylie Minogue&s=Can't Get You Out Of My Head
of dit:
http://www.mp3-drug.com/projectz/download?a=Zucchero&s=Baila
Bij de eerste verschijnt er helemaal niks en bij de tweede zou hij ook nog een ander nummer dat 'Bailanda' heet moeten vinden. Dat doet hij niet, wie weet wat er mis is met deze code?
Bij voorbaat dank!
Nu heb ik het volgende geschreven
PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
| <? <? require("variables.php3"); $color2 = "#E0E0E0"; $color1 = "#FFFFFF"; $sql = "SELECT * FROM mp3s WHERE (Artist = '$a' AND Song = '$s') order by Artist ASC"; $result = mysql_query($sql); $aantal = mysql_num_rows($result); $sql2 = "SELECT * FROM mp3s WHERE (Artist LIKE '%$a%' || Song LIKE '%$s%') order by Artist ASC"; $result2 = mysql_query($sql2); $aantal2 = mysql_num_rows($result2); if (($aantal > 0) and ($aantal2 > 0)) { ?> <table width="395" border="0" cellspacing="0" cellpadding="0"> <tr valign="top"> <td height="2" background="img/achternieuws.jpg"> <div align="left"><font size="2" face="Arial, Helvetica, sans-serif" color="666666"><b><i>100% match with artist and title</i></b></font></div> </td> </tr> <tr valign="top"> <td> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <? while ($row = mysql_fetch_object($result)) { if ($color == "$color1") { $color = "$color2"; } else { $color = "$color1"; } $artist = stripslashes($row->Artist); $song = stripslashes($row->Song); ?> <tr> <td><a href="getsong?id=<? echo "$row->id" ?>&key=<? echo "$row->verify"; ?>"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"> <? echo "$artist - $song"; ?></a></td> </tr> <? } ?> </table> </td> </tr> </table> <br> <table width="395" border="0" cellspacing="0" cellpadding="0"> <tr valign="top"> <td height="2" background="img/achternieuws.jpg"> <div align="left"><font size="2" face="Arial, Helvetica, sans-serif" color="666666"><b><i>No 100% match with artist and title</i></b></font></div> </td> </tr> <tr valign="top"> <td> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <? while ($row2 = mysql_fetch_object($result2)) { if ($color == "$color1") { $color = "$color2"; } else { $color = "$color1"; } $artist2 = stripslashes($row2->Artist); $song2 = stripslashes($row2->Song); ?> <tr bgcolor="<? echo"$color"; ?>"> <td><a href="getsong?id=<? echo "$row2->id" ?>&key=<? echo "$row2->verify"; ?>"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"> <? echo "$artist - $song"; ?></a></td> </tr> <? } ?> </table> <? } elseif (($aantal > 0) and ($aantal2 == 0)) { ?> <table width="395" border="0" cellspacing="0" cellpadding="0"> <tr valign="top"> <td height="2" background="img/achternieuws.jpg"> <div align="left"><font size="2" face="Arial, Helvetica, sans-serif" color="666666"><b><i>100% match with artist and title</i></b></font></div> </td> </tr> <tr valign="top"> <td> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <? while ($row = mysql_fetch_object($result)) { if ($color == "$color1") { $color = "$color2"; } else { $color = "$color1"; } $artist = stripslashes($row->Artist); $song = stripslashes($row->Song); ?> <tr bgcolor="<? echo"$color"; ?>"> <td><a href="getsong?id=<? echo "$row->id" ?>&key=<? echo "$row->verify"; ?>"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"> <? echo "$artist - $song"; ?></a></td> </tr> <? } ?> </table> <? } elseif (($aantal == 0) and ($aantal2 > 0)) { ?> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <? while ($row2 = mysql_fetch_object($result2)) { $artist2 = stripslashes($row2->Artist); $song2 = stripslashes($row2->Song); ?> <tr bgcolor="<? echo"$color"; ?>"> <td><a href="getsong?id=<? echo "$row2->id" ?>&key=<? echo "$row2->verify"; ?>"><? echo "$artist - $song"; ?></a></td> </tr> <? } ?> </table> <? } else { echo"<font face=\"Arial, Helvetica, sans-serif\" size=\"2\" color=\"666666\">No Mp3's have been found!"; } ?> |
behoorlijk stuk ja...
Maar nu krijg ik helemaal geen resultaten met 100% of niet
Bijvoorbeeld dit:
http://www.mp3-drug.com/projectz/download?a=Kylie Minogue&s=Can't Get You Out Of My Head
of dit:
http://www.mp3-drug.com/projectz/download?a=Zucchero&s=Baila
Bij de eerste verschijnt er helemaal niks en bij de tweede zou hij ook nog een ander nummer dat 'Bailanda' heet moeten vinden. Dat doet hij niet, wie weet wat er mis is met deze code?
Bij voorbaat dank!