very odd PHP prob

W

wyrd_fish

Guest
http://mooses.34sp.com/blue/shout.php

i'm making a shout box... but as you can see the form id above all the enteries, although in the script it is below... veery odd i thought...

at first I thought it was because the connection script was tacking to long so i moved it out ot that section and in to the very top of the script but that failed to work and i'm noe out of ideas...

please help...
 
J

Jonty

Guest
Hello :)

The problem is that your source code is a little messy :D The problem is caused because the table containing all the shouts has no end tag (e.g. </table> is omitted). To fix the problem, find the following line of code . . .

Code:
<tr><td height="1" bgcolor="navy"></td></tr>
. . . and underneath add '</table>', thus creating . . .
Code:
<tr><td height="1" bgcolor="navy"></td></tr>
</table>
You should find that this fixes everything (I assume this is what you were wanting to fix?). Also, there's a slight error when generating the website links in the shouts. This occurs just because there's a quote out of place, something that I'm sure we've all done a few times when coding :) Take (Shovel)'s link . . .
Code:
[url="http:// Webiste URL target="]Shovel[/url]
. . . it should read . . .
Code:
[url="http:// Webiste URL"]Shovel[/url]
That should stop people's website addresses from 404'ing.

Kind Regards
 
W

wyrd_fish

Guest
well done jonty...


now I need query help...

it needs to be ordered decending for the query, but assending for the mysql_fetch_array, I can do the latter but not teh former...

ps. how do you change the width of text boxes...??????

PPS thanks
 
J

Jonty

Guest
Hello :D

Just a flying visit I'm afraid :( Basically, I'm not sure you can directly order mysql_fetch_array(). Instead, you have to specify your order in the query associated with the function. If you can, alter the existing query accordingly, else just create another query with the order you need and execute that alongside your existing query. I've probably not explained that too well, just say if that's the case.

As for the width of text boxes, you can either add the size attribute or alter the width via cascading stylesheets (CSS). Adding the size attribute specifies how many characters wide you want the element. So if you wanted the box 25 characters/letters wide, you would use . . .

Code:
<input ... size="25" />
Alternatively you can use CSS to specify the width of the element, e.g. for an element 150 pixels wide . . .

Code:
<input ... style="width:150px" />
Kind Regards
 
W

wyrd_fish

Guest
i figured out the text boxes just after posting, but I'm sure that you can order in mysql_fetch_array() and in the query
 
J

Jonty

Guest
Hello :)

Glad you've got those textboxes sorted :) As for mysql_fetch_array(), I've checked the PHP Manual and there doesn't seem to be any immediate way of ordering outside of the original query. That said, if you find a way, please post it, since it could be quite useful :)

Kind Regards
 
W

wyrd_fish

Guest
well...

sorted it

I had to find the number of rows in total... then -20 from it, this gave me a starting point from witch to limit it... and still have the latest 20 in desc order...

also, it needs an if, just incase there are less that 20 rows in teh table:

if($start < "0"){
$start = "0";
}

sorted...
 

Users who are viewing this thread

Top Bottom