It may be, but I must give credit where credit is due!
And its true because my idea is so much brighter now that I have the understanding I have come to possess via this thread.
Pity about those book writing skills though… But I did take a look at your blog and I guess that the predicament you’re in what with your guru sized intelligence level causing your chain of thought to move faster than the body will actually allow you to type, I mean… I guess i can kind of identify with your whole theory on not being good with writing as a result because I could say i suffer from the same dilema, only its my spoken words that seem to stuggle playing catch up with where my thoughts are at
I have to add too, that ecart script your have on there looks like its pretty pimped! Very impressive!
Well one more thing too, your reasoning behind your chosen domain name is… Freaking classic! haha! (for real)
On a more serious note though, I have been studying this script of yours. There are a few things that confuse me, and yes it is very slightly buggy, but it really looks rock solid, im sure im just missing something here… I say this because, okay. I added it to my page, but it came has a mysql error, let me see.
“You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘)’ at line 1”
Now, I eventually realised that this error was caused by this line:
$query = 'SELECT COUNT(*) FROM `content` WHERE `pid`="2" && `models`="all")';
So i took out the unneeded(?) bracket. Now im stuck on this error:
“Warning: Division by zero in /blah/server/path/test3.php on line 157
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘’ at line 1”
This is a tad confusing because I assume that the line one its referring to is the first line of some sql query after the point where i took out the bracket. I have no idea why its warning me about the division by zero, but i am assuming this has something to do with my db only having 3 content entries? In anycase, line 157 is this line which appears a few lines after the line I corrected.
$total_pages = ceil($total_results / $max_results);
So it got that far and got stuck, that I understand, but the reason why? hmm… lets see, there are 4 references to ‘’, they are:
if (empty($val) || $val==null || $val=='' || $val==0) {
This one appears before it got stuck previously so i am assuming, but not so sure that it has nothing to do with this, that leaves us with these:
$loopResult = '';
$addSelection = '';
$pagenums = '';
Hmm, thats where i am stuck because looking at the bits of sql ‘near’ there i really dont see anything a miss, which leads me to think that i simply do not know enough about the information I am looking at to understand the issue here
Which brings me back to what I was thinking orignally, but found myself not so sure about… And that is that the current error has something (im not sure what yet) to do with that vdata function? Either that or it has something to do with the way this peice of code ends:
$query = 'SELECT COUNT(*) FROM `content` WHERE `pid`="2" && `models`="all"';
Ofcourse it could actually have nothing to do with the " ‘’ " symbols but hey, thats as far as I am here.
Besides that, I have another question. From what I can tell, this script will display all rows with a pid of 2 and models = chosen, or ones that have a pid of 2 and models = all. Now im a bit confused because i’d want any row with a pid of 2 and a models value of all or $chosen.
So essentially i should have this instead?:
/*
now get and process teh actual data now that
we know it exists.
*/
$loopResult = '';
if (!empty($chosen)) {
$query2 = 'SELECT * FROM `content` WHERE `pid` = "2" && (`models`="all" || models="'.$chosen.'") ORDER BY `title` ASC LIMIT ' . $from . ', ' . $max_results;
$addSelection = '&chosen=' . urlencode(stripslashes($chosen));
}
$result = sqlassoc($query2);
while($row = $result) {
$loopResult = '
<div class="dlcontainer">
<div class="dlitem">
<div class="dltitle">'.$row['title'].'</div>
<div class="dlimage">'.$row['image'].'</div>
<div class="dldescription">'.$row['description'].'</div>
<div class="dllink">'.$row['downlink'].'</div>
</div>
</div>
';
}
No ‘else’?
I wouldnt want it to show only items that have a value of $chosen, or only items that show all. I’d like the $chosen to suppliment the default data showed, which would be all rows with the value of all.
All would be any download that would operate on any phone model, additionally some downloads would only be available to certain models.
But looking at that code again, i think im just confused because the else does need to be there and this script would operate in the same way I am describing?
O well, looks like I need to look harder!