PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi Guys and Girls,
Right the problem with the following code is that it does not do two things
1) Does not output any results from the database
2) Radio button does output the all the UserID's
Please some help would greatful or some example code would be better...
Thanking in advance
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
The script doesn't work without opendb.php, therefore do not use include, use require instead.
$UserID is probably supposed to represent the parameter sent by your form. That's depreacted, use $_GET['UserID'] or $_POST['UserID'] instead and have a read of http://de2.php.net/manual/en/security.globals.php
Your script is prone to sql injections, see http://de.php.net/security.database.sql-injection
mssql_query returns false if something went wrong with the query. You should check that condition.
Right I'm started to get somewhere, i edited the code(slightly) as follows: but the problem is know that its outputting the table header twice, any suggestions, and its not outputting all the records from the database.
mssql_num_fields() returns the number of fields in each row in the result, not the number of rows. This is why not all the results are displaying. Perhaps you should read the manual.
Your header is printing multiple times because you put it inside the loop that outputs the results.
I removed the form elements and completely forgot to remove the <form> tag. Anyway, you get the idea of what you are supposed to do. Glad I was able to help.
Maybe i'm being a pest but could you give me the version you got with the radio buttons, because i'm configuring the script to be used with radio buttons and it does not seem to work. My bad. Sorry. Much apperciated..