it's suppose to find a name on the database.
<?php
$s = $_POST["lname"];
$x = trim($s);
$exists = false;
$selectedRow = 0;
mysql_connect (localhost,testuser,testuser);
mysql_select_db (testuser);
mysql_query("DROP TABLE myTable");
mysql_query("CREATE DATABASE myDatabase");
mysql_query("USE myDatabase");
mysql_query("CREATE TABLE myTable (firstname VARCHAR(20), " .
"lastname VARCHAR(20), birthdate DATE, dependents INT, ss VARCHAR(11))");
mysql_query("LOAD DATA LOCAL INFILE 'names.txt' INTO TABLE myTable")
or die(mysql_error());
$s = mysql_query("SELECT * FROM myTable ORDER BY lastname");
$rows=mysql_numrows($s);
for($i = 0; $i < $rows; $i++){
$result = trim(mysql_result($s,$i,"lastname"));
if ( strcmp($x, $result) == 0 )
{
$exists = true;
$selectedRow = $i;
}
}
if ($exists == true)
{
$f = mysql_result($s,$selectedRow,"firstname");
$l = mysql_result($s,$selectedRow,"lastname");
$b = mysql_result($s,$selectedRow,"birthdate");
//$d=str_pad(mysql_result($s,$selectedRow,"dependents"), 18, " ");
//$ss=mysql_result($s,$selectedRow,"ss");
print "$f "."$l
Your date of birth is ".$b;
}
else
{
print "$x
Your name is not listed";
}
mysql_query("DROP DATABASE myDatabase") or die(mysql_error());
mysql_close();
?>
styling a RadioButtonList
HiI need to have a radio button and close to it, its lable, then a space then another set of those. I have the relevent html but not able to come up with the css. please helpthxview plaincopy to
same querie, or a new one??
Hi guys,I'm still working on this drop down list. I've got the actual drop down list to work (call all the "pname"s from the table, and I've even found how to print the result once you
php is not recognized as an internal or external command
Hello,I am trying to bake the code in CakePHP through my console.I have changed my Path in Environment Variables but still I am getting this error in console "php is not recognized as an internal
Extracting Long text from message class with parameters
Hi,
undefined offset help
Hi All,I kept getting undefined offset PHP notice for a simple for loop. For eg$va = array();$i=0;while($row = mysql_fetch_array($result)){ $va[$i] = $row['id']; $i++;}It gives undefined offset at
SuperCali PHP Event Calendar
does anyone have any experience with the SuperCali PHP Event Calendar? I could use some assistance in writing a custom function for it, anyone ever messed with it before?
Is there a way to override built in php functions without APD?
I am trying to use the rename_function()override_function() options that are built into the APD php extension. But I don't want to rely on that extension being loaded.This is another one of my
Prevent PHP mail( ) from appending hostname to from address
Hey guys,I want to be able to send texts to phones via email (since each phone has their own address), and for specifying the from, I want to specify my own number, is there a way to do this?For
help with this code please?
Hello,I am trying to build a remote upload script for my image hosting site.I am using $_GET for testing purposes.this would be the url you would visit:Code:
simple ping code
been searchin the site/web and found code thats simple but doesnt work.I have a personal web server running with various things and a place to upload or down load files from out side my lan.I am