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: <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: $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?
Date Format
Hi there,I have a date format like this right now:Sat, 17 Oct 2009 17:04:00 I need to turn that into:2009-10-17T17:04:00ZMy thought process was to remove with regex "Sat," and then just
Will this protect from mysql injection?
I do not want anything like DROP TABLE to work or any type of coding.. Heres my code.. is it secure? if not, please help:Code:
parameter passing issue on function
Well I thought I had created a pretty slick web page, using ?page and $_GET to load pages which where really function calls.Here is a few lines that make up the menuCode:
Web Host List
Here is a list of web hosts that offer PHP and MySQL. It is no where near a full list, but it is most popular. I'm locking this so you can't reply. I am pulling this list from the most popular google
Issues: PHP Forms -Clearing
I've tried looking online before actually asking for help, but I've been looking for about the past 3-5 hours and have found nothing that'll help me.This is a project for school, and well I have to
PDO returns erroneous columns from within pdt
Hi All,This is a truly weird behavior:When using a simple pdo fetch, erroneous columns are returned!Steps to reproduce:------------------------------------------------------------ -----------1.create
why is it over writing
Code: $filepaths[] = $_FILES['new_image'];foreach ($filepaths as $filepath){$imagename = strtolower($filepath['name']);$charref = substr($imagename, 0, strrpos($imagename, '.'));
$variable = $variable
HelloSorry if this is a really simple question but I have run out of ideas. Is there a really simple way of doing the following:$animal_dog = $something_something[$i]['animal_dog'];$animal_cat =
Contact Form Not Working When I Add Validation Codes
So I built my first working PHP "Contact Us" like form. But, I have been trying to now make the form Validate for empty fields when the user hits the submit button. Problem is when I added
SOAP Issue
Hi,I am facing some understanding problem with SOAP basic.kindly recommend some SOAP expert.Thanks