I have a test database set up on localhost. I have a form that I can type a name into, hit the button and it puts the name into the database and into a list on my page. it works fine. Now, I wanted to make a drop down list with all the names so that you could select one to remove that name from the database. So I did this
Code: [Select]<form>
<select>
<option><?php echo $name ?></option>
</select>
</form>
What that did was list the very last name in the list. What I thought it would do was list all the names based on the loop that I have set up to read all the names from the database. which is this
Code: [Select]$mysql = new mysqli('localhost', 'myusername', 'mypass', 'mydatabase') or die('not working');
$result = $mysql->query("SELECT * FROM myTable") or die($mysql->error);
if($result)
{
while($row = $result->fetch_object())
{
$name = $row->names;
echo $name . "<br />";
}
}
Now the while loop is in a file I called results and it is included in the index page with an include. I thought this would give me access to the $name variable and allow me to use it the same way it's being used in the loop. of course I was wrong, so how do I use it the same way?
Help with captcha script needed
Hello, I am working on a script where reCAPTCHA or a similar form of CAPTCHA will be used, for the sake of this example I will talk about reCAPTCHA. I wanted to know how I could have the reCAPTCHA
Using mysql_real_escape_string for displayed content
On my website users can input data into a textarea and it will store it in the mysql database. But, I am unsure on how to prevent against mysql injections without using mysql_real_escape_string since
Working with popups and such in a class
I've recently started building my applications completely enclosed in classes. I like the fact that I can base everything off one root and work with that, but I'm having a problem with popups
Compare user input to flat file data
Help...Am a complete newbie to programming so my code is prolly quite long. Am trying to verify a users details entered into a login form against details stored in an existing flat file.No matter what
How to clone an SAP ECC using bacup tape on z/os?
We want to clone our production to a different SID using backup tape.
how to read and write into a word document using php...?
hi,I need,reading and writting into a word document using php.Thank u inadvance,Madhu
Need Reporting Advice
My SQL server doesn't support MS SQL reporting services that comes with SQL Enterprise or Express. Then the administrator suggested that I google for alternatives. I'm a newbie and don't even know
PHP MySQL and DATE
Hi everyoneI have a databse and in one of the columns I have date values such as 2009-March-27. If i have a php interface and want to use a query to select all the rows that is in say october. how
Business Health Check
Hello I need to create an online business health check for a client it will be multiple choice and about 50 questions but the client has requested that the output/results of the health check needs to
Solution to the FindControl problem
I have seen may posts about having problems with the FindControl method. Most seem to come about because the control being searched for is nested within a container other than the webform.I came