PHP - Database Modification Script Help
My first real attempt to mess with MySql.
Keep getting a syntax error and I am quite confused. Error: Code: [Select] Parse error: syntax error, unexpected '}' in /home/a8152576/public_html/MemberSystem/install1.php on line 68 Here is my php code: Code: [Select] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <form id="form1" name="form1" method="post" action=""> <h2><center>Fill in the following info properly to install required databases.</center></h2> <p> <label>Host: <input type="text" name="host" id="host" /> </label> </p> <p> <label>Database User: <input type="text" name="dbUser" id="dbUser" /> </label> </p> <p> <label>Database Password: <input type="text" name="dbPass" id="dbPass" /> </label> </p> <p> <label>Desired Admin Username: <input type="text" name="adminName" id="adminName" /> </label> </p> <p> <label>Desired Admin Password: <input type="text" name="adminPass" id="adminPass" /> </label> </p> <p> <label>Email: <input type="text" name="adminEmail" id="adminEmail" /> </label> </p> <p> <input type="submit" name="submitBtn" id="submitBtn" value="Submit" /> </p> </form> <?php if(isset($_POST['submit'])){ $hostName = $_POST['host']; $dbUserName = $_POST['dbUser']; $dbPassword = $_POST['dbPass']; $adminUserName = $_POST['adminName']; $adminPassword = $_POST['adminPass']; $email = $_POST['adminEmail']; $sqlLink = mysql_connect('$hostName','$dbUserName','$dbPassword'); if(!$sqlLink){ die('Could not connect: ' .mysql_error()); mysql_close(); } else { $queryCreate = 'CREATE DATABASE member_db'; echo 'Connected successfully!'; if(mysql_query($queryCreate,$link)){ echo 'Created database!'; mysql_select_db('member_db'); $createAdminTable = "CREATE TABLE " .$adminUserName. " (`secLvl` tinyint(1) default NOT NULL,`rank` tinyint(2) default NOT NULL,`username` varChar(32) NOT NULL UNIQUE,`password` varChar(32) NOT NULL,`email` varChar(32) NOT NULL UNIQUE"; $insertAdminInfoQuery = "UPDATE " .$adminUserName. " SET `secLvl` = '5', `rank` = '10', `username` = '$adminUserName', `password` = '$adminPassword', `email` = '$email' WHERE '$adminUserName' LIMIT 1"; mysql_query($createAdminTable) or die("ERROR: " .mysql_error()); mysql_query($insertAdminInfoQuery) or die("ERROR: " .mysql_error()) } else { echo 'Error: '.mysql_error(); } } } ?> </body> </html> You can even see the error on this web page directly: http://www.ptcptc.info/MemberSystem/install1.php Thanks, Brandon Similar TutorialsThis code works when theres no predefined value however I'm trying to modify it in case there IS a value from the DB which is from the " . $row2['content'] . " data. Code: [Select] echo "<select name=" . $row2['ID'] . " id=" . $row2['ID'] . " class=dropdown biofield title=" . $row2['fullName'] . " >"; echo "<option value= >None</option>"; if ($styleID == 1 || $styleID == 2 || $styleID == 6) { $charactersQuery = " SELECT characters.ID, characters.characterName FROM characters WHERE characters.styleID = 3 ORDER BY characters.characterName"; } else { $charactersQuery = " SELECT characters.ID, characters.characterName FROM characters WHERE characters.styleID IN (1,2,6) ORDER BY characters.characterName"; } $charactersResult = mysqli_query ( $dbc, $charactersQuery ); // Run The Query while ( $row3 = mysqli_fetch_array ($charactersResult, MYSQLI_ASSOC)) { echo "<option value=" . $row3['ID'] . ">" . $row3['characterName'] . "</option>\r"; } echo "</select>"; I normally use something like this but with the other code not sure how to modify it to work the same way. Code: [Select] while ( $champion_row = mysqli_fetch_array ( $charactersResult, MYSQL_ASSOC ) ) { print "<option value=\"".$champion_row['ID']."\" "; if($champion_row['ID'] == $row['champID']) { print " SELECTED"; } print ">".$champion_row['characterName']."</option>\r"; } I am trying to get this script to display the date like Dec 17, 2010 and have the search function work too. If I try to change the date the search malfunctions and if I take the date function away the date is 2010 12 17 I thought we had this nailed down the other day but in my excitement I neglected to test the city search. Here is the script. <?php $find = trim($_GET['find']); $field = $_GET['field']; if($find && $field) { // we have search form submitted // check for values to prevent sql injection $valid_fields = array("venue_state", "venue_city", "start_date"); if(!in_array($field, $valid_fields)) die("Error: Invalid field!"); //connect mysql_connect("localhost", "arts_cshow", "TrPh123Yuo") or die(mysql_error()); mysql_select_db("arts_shows") or die(mysql_error()); echo "<h2>Search Results for $find in $field</h2>\n"; $find = addslashes($find); $result = mysql_query("SELECT * FROM craft_shows WHERE $field LIKE '%$find%'"); if(mysql_num_rows($result) == 0) { echo "<p>0 matches found.</p>"; } else { echo "<table><tr><td class=\"shows\">"; $sql = "SELECT *, DATE_FORMAT(`start_date`, '%b %e, %Y') AS s_date FROM craft_shows"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)) { echo "<a href='/show_submits/show_detail.php?id={$row['id']}'>Details</a>\n"; echo $row['venue_state'] . " {$row['s_date']} {$row['show_name']} {$row['venue_city']}<br>\n"; } echo "</td></tr></table>\n"; } } ?> thanks I am currently trying to build a contact form for a website. I have been given a script to use that was used on another site but it has an iff statement in it to change the strEmail according to the location and requirement. Thank you for writing this script. It has been most helpful in doing a search for a website I manage. Everything is working fine but I would like some help in modifying the "$results[] = " line. For instance, I would like to show or hide the address of a business if a data value is set to 1 if set to 0 then hide. Same for the business web address. if ( $row_memberrs['WebAddress'] != NULL ) { echo <a href=\"{$row['WebAddress']}\" target=_blank>Visit our website</a>; } I am a newbie to php and would appreciate any help you can give me. Here is a link to the search page http://www.wildwoodba.org/searchsite.php If it is not too much trouble I would like to hide the check boxes and make it search the body, title or disc for the words entered. Thank you for your help. Hi all. I have the following function which auto-generates a form based on a database table. What I want to do is "cancel" the function if the table doesn't exist. The function as is... function build_form($table_name){ $sql="SELECT * FROM $table_name"; $result=mysql_query($sql); $num=mysql_num_rows($result); $i=0; echo "<form method=\"post\" action=\"/php/process_data.php\">"; echo "<input type=\"hidden\" name=\"selected_table\" value=\"" . $table_name . "\"/>"; echo "<table>"; echo "<tr><td colspan=\"2\" style=\"font:1em arial;font-weight:bold;text-align:center;\">Input Form: " . $table_name ."</td></tr>"; $field_names=array(); while ($i < mysql_num_fields($result)){ $fields=mysql_fetch_field($result,$i); echo "<tr><td>" . $fields->name . "</td><td><input type=\"text\" size=\"30\" name=\"" . $fields->name . "\" /></td></tr>"; $i++; }; echo "<tr><td colspan=\"2\" style=\"text-align:center;\"><input type=\"submit\" value=\"Submit Data\" style=\"width:75%\" /></td></tr>"; echo "</table>"; echo "</form>"; }; Would something like this work? (note lines 3-5) function build_form($table_name){ $sql="SELECT * FROM $table_name"; if(!$sql){ return; }; $result=mysql_query($sql); $num=mysql_num_rows($result); $i=0; echo "<form method=\"post\" action=\"/php/process_data.php\">"; echo "<input type=\"hidden\" name=\"selected_table\" value=\"" . $table_name . "\"/>"; echo "<table>"; echo "<tr><td colspan=\"2\" style=\"font:1em arial;font-weight:bold;text-align:center;\">Input Form: " . $table_name ."</td></tr>"; $field_names=array(); while ($i < mysql_num_fields($result)){ $fields=mysql_fetch_field($result,$i); echo "<tr><td>" . $fields->name . "</td><td><input type=\"text\" size=\"30\" name=\"" . $fields->name . "\" /></td></tr>"; $i++; }; echo "<tr><td colspan=\"2\" style=\"text-align:center;\"><input type=\"submit\" value=\"Submit Data\" style=\"width:75%\" /></td></tr>"; echo "</table>"; echo "</form>"; }; This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=355561.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=327718.0 I have a table in my database which stores lot of file names & file path. iam currently listing the files on the basis of its uploaded date (stored in databse) but I want to list it on the basis of its file modification time. How i can do it ?? my current sql statement is Code: [Select] $sql = mysql_query("SELECT * FROM `files` WHERE `cid` = '$types' ORDER BY `uploaded` DESC LIMIT $start,$limit"); anyone can help me ?? i'm just having a little bit of a play around making a browser-based text RPG with PHP and mySQL. But when it comes to creating a system where a player can view their inventory, and for that matter -have- items. i just don't know where to begin. Would i make a seperate database for inventories and have each column in the database be a different inventory slot and then have the value in that field be in reference to an item? like 1 = potion, 2= ether, etc? with a large amount of items and inventory space for each player i don't want to get started down a long road on the wrong path. To reiterate, I'm not asking for the code specifically i'm just asking what way I would go about it. What would be the simplest, least headachey method of such a system? Hi,
I have the following code which gives a fading out effect when clicking on links. I need to be able to disable it for anchor links so it is disabled when using # as the link.
Any ideas ?
/* * Function to animate leaving a page */ $.fn.leavePage = function() { this.click(function(event){ // Don't go to the next page yet. event.preventDefault(); linkLocation = this.href; // Fade out this page first. $('body').fadeOut(400, function(){ // Then go to the next page. window.location = linkLocation; }); }); };Thanks, Scott. Hello Coder Guys, I need a small help from you. I want to list all files & directories based on last file modification time of server. I want to list new files as first & old files as last. Consider "files" as the directory name which contains all files & directories. Please make the php code to display all files & directories from "files" directory based on last file modification time of server. Thanks IN Advance ! Hey, sorry I'm a newb so prepare for me to do everything wrong even though I read the FAQ.
I'm trying to use a simple php script to input data to register but I get this error:
"Failed to run query: SQLSTATE[HY093]: Invalid parameter number: parameter was not defined" once I fill out the form.
I've seen other people get this error but I seem to have different problems to them and can't figure it out.
My PHP script is just
<?php require("config.inc.php"); //if posted data is not empty if (!empty($_POST)) { if (empty($_POST['username']) || empty($_POST['password'])) { $response["success"] = 0; $response["message"] = "Please Enter Both a Username and Password."; die(json_encode($response)); } $query = " SELECT 1 FROM users WHERE username = :user"; $query_params = array( ':user' => $_POST['username'] ); try { $stmt = $db->prepare($query); $result = $stmt->execute($query_params); } catch (PDOException $ex) { die("Failed to run query: " . $ex->getMessage()); $response["success"] = 0; $response["message"] = "Database Error. Please Try Again!"; die(json_encode($response)); } $row = $stmt->fetch(); if ($row) { die("This username is already in use"); $response["success"] = 0; $response["message"] = "I'm sorry, this username is already in use"; die(json_encode($response)); } $query = "INSERT INTO users ( username, password ) VALUES ( :user, :pass ) "; $query_params = array( ':username' => $_POST['username'], ':password' => $_POST['password'] ); try { $stmt = $db->prepare($query); $result = $stmt->execute($query_params); } catch (PDOException $ex) { die("Failed to run query: " . $ex->getMessage()); $response["success"] = 0; $response["message"] = "Database Error. Please Try Again!"; die(json_encode($response)); } $response["success"] = 1; $response["message"] = "Username Successfully Added!"; echo json_encode($response); } else { ?> <h1>Register</h1> <form action="index.php" method="post"> Username:<br /> <input type="text" name="username" value="" /> <br /><br /> Password:<br /> <input type="password" name="password" value="" /> <br /><br /> <input type="submit" value="Register New User" /> </form> <?php } ?>and the config: <?php $username = "root"; $password = ""; $host = "localhost"; $dbname = "drinkdealz"; $options = array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'); try { $db = new PDO("mysql:host={$host};dbname={$dbname};charset=utf8", $username, $password, $options); } catch(PDOException $ex) { die("Failed to connect to the database: " . $ex->getMessage()); } $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC); if(function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) { function undo_magic_quotes_gpc(&$array) { foreach($array as &$value) { if(is_array($value)) { undo_magic_quotes_gpc($value); } else { $value = stripslashes($value); } } } undo_magic_quotes_gpc($_POST); undo_magic_quotes_gpc($_GET); undo_magic_quotes_gpc($_COOKIE); } header('Content-Type: text/html; charset=utf-8'); session_start(); ?>Sorry if I uploaded anything wrong and it's only a localhost so I don't really care about passwords etc (none will be the same when I upload it) So if any of you can even point me in the direction of what to look for that would be brilliant. Cheers, Kieran Hello everybody, I have found a lot of amazing advises and codes to improve on my existing codes. It seems to be an awesome site. I actually came from a background of Application programming, however I have just recently pick up a project in php. The project is about database integration, where I have to integrate 5 supplier's existing data who have different attributes into one. (each suppliers have about 30k data) I really need help and advises on how should I do the script. Here's the details, All the suppliers uses different data file, such as CSV and .xls. I am finding a way to integrate all the 5 files into one database(mysql/phpmyadmin) so it could be listed out in a shopping cart or catalog in future. However, I am unfamiliar with php, so please advice on how can i go about fixing this problem. The first problem is that each individual suppliers uses a different attributes name, for example Supplier 1 uses : SupplierName, SupplierID, SupplierAddress, Status Inside the status, the supplier uses data such as, Good, Excellent, Great while Supplier 2 uses : SName, SID, SAddress, Status and inside this supplier, the status data that are being uses is G, Ex, Gr. How can I set a consistancy on the data and converting all the properties into one so I can import this data into a proper database such as mysql/phpmyadmin. Please help, thanks in advance Hey... I was going through this sample that was given in the class, but got confused at the first point "//change this to include your own database connect script. include "../../dbconnect.php";" and the database connection code is "<?php if ($_POST['submit']) { // connect to your database $connection = pg_connect("port=5432 dbname=rr_ds user=nobody"); if (!$connection) { die("Connection has failed: " . pg_last_error()); }?> " the database connection code is from a previous assignment which i did, but that was for a login page. The current assignment is to connect to the database and have data on it. Hi, Im just in the middle of creating an update script for my mysql database but don't know why it's not working. p.s. I'm a little new to PHP, but know quite a bit, it's probably something really small.. *facepalm* Here's the script: the form (update.php) <? // Connect to the database $link = mysql_connect('###', '###', '###'); if (!$link) { die('Could not connect: ' . mysql_error()); } mysql_select_db('###', $link); $id = $_GET['id']; // Ask the database for the information from the links table $query="SELECT * FROM orders WHERE id='$id'"; $result = mysql_query("SELECT * FROM orders"); $num=mysql_numrows($result); mysql_close(); $i=0; while ($i < $num) { $name=mysql_result($result,$i,"Name"); $location=mysql_result($result,$i,"Location"); $fault=mysql_result($result,$i,"Fault"); ?> <form action="updated.php" method="post"> <input type="hidden" name="ud_id" value="<? echo "$id";?>"> Name: <input type="text" name="ud_name" value="<? echo "$name"?>"><br> Location: <input type="text" name="ud_location" value="<? echo "$location"?>"><br> Fault: <input type="text" name="ud_fault" value="<? echo "$fault"?>"><br> <input type="Submit" value="Update"> </form> <? ++$i; } ?> ------------------------------------------------------ (processor) updated.php <?php // Connect to the database $link = mysql_connect('###', '###', '###'); if (!$link) { die('Could not connect: ' . mysql_error()); } mysql_select_db('###', $link); $query="UPDATE orders SET Name='" . $_POST['ud_name'] . "', Location='" . $_POST['ud_location'] . "', Fault='" . $_POST['ud_fault'] . "' WHERE $id='" . $_POST['ud_id'] . "'"; echo $query; $checkresult = mysql_query($query); if ($checkresult) echo '<p>update query succeeded'; else echo '<p>update query failed'; mysql_close(); ?> ------------------------------------------------------ Every time I want to update, it comes up with: UPDATE orders SET Name='TEST', Location='TEST', fault='jbjh' WHERE ='' update query failed Any help would be appreciated. Hi, i'm basically having problems with this code, its for a newsletter script which added the email address into a file, i'm trying to convert it to work with mysql but having a few problems; I've edited the last bit, the code just basically doesn't add it to the database even though i thought i had done it right... any help is very much appreciated! If email is not valid the script is letting me know; if email is valid it says "already added to the list" no matter what. old script <?php /** BY WebResourcesDepot - http://www.webresourcesdepot.com*/ /** YOU CAN EDIT HERE*/ $newsletterFileName = "file.txt"; /** IMPORTANT: EDIT BELOW UNLESS YOU KNOW WHAT YOU ARE DOING*/ function GetField($input) { $input=strip_tags($input); $input=str_replace("<","<",$input); $input=str_replace(">",">",$input); $input=str_replace("#","%23",$input); $input=str_replace("'","`",$input); $input=str_replace(";","%3B",$input); $input=str_replace("script","",$input); $input=str_replace("%3c","",$input); $input=str_replace("%3e","",$input); $input=trim($input); return $input; } /**Validate an email address. Provide email address (raw input) Returns true if the email address has the email address format and the domain exists. */ function validEmail($email) { $isValid = true; $atIndex = strrpos($email, "@"); if (is_bool($atIndex) && !$atIndex) { $isValid = false; } else { $domain = substr($email, $atIndex+1); $local = substr($email, 0, $atIndex); $localLen = strlen($local); $domainLen = strlen($domain); if ($localLen < 1 || $localLen > 64) { // local part length exceeded $isValid = false; } else if ($domainLen < 1 || $domainLen > 255) { // domain part length exceeded $isValid = false; } else if ($local[0] == '.' || $local[$localLen-1] == '.') { // local part starts or ends with '.' $isValid = false; } else if (preg_match('/\\.\\./', $local)) { // local part has two consecutive dots $isValid = false; } else if (!preg_match('/^[A-Za-z0-9\\-\\.]+$/', $domain)) { // character not valid in domain part $isValid = false; } else if (preg_match('/\\.\\./', $domain)) { // domain part has two consecutive dots $isValid = false; } else if (!preg_match('/^(\\\\.|[A-Za-z0-9!#%&`_=\\/$\'*+?^{}|~.-])+$/', str_replace("\\\\","",$local))) { // character not valid in local part unless // local part is quoted if (!preg_match('/^"(\\\\"|[^"])+"$/', str_replace("\\\\","",$local))) { $isValid = false; } } } return $isValid; } $email = GetField($_GET['email']); $pass = validEmail($email); if ($pass) { $f = fopen($newsletterFileName, 'a+'); $read = fread($f,filesize($newsletterFileName)); If (strstr($read,"@")) { $delimiter = ";"; } if (strstr($read,$email)) { echo 3; } else { fwrite($f, $delimiter . $email); echo 1; } fclose($f); } else { echo 2; } ?> edited script <?php /** BY WebResourcesDepot - http://www.webresourcesdepot.com*/ /** YOU CAN EDIT HERE*/ $newsletterFileName = "file.txt"; /** IMPORTANT: EDIT BELOW UNLESS YOU KNOW WHAT YOU ARE DOING*/ function GetField($input) { $input=strip_tags($input); $input=str_replace("<","<",$input); $input=str_replace(">",">",$input); $input=str_replace("#","%23",$input); $input=str_replace("'","`",$input); $input=str_replace(";","%3B",$input); $input=str_replace("script","",$input); $input=str_replace("%3c","",$input); $input=str_replace("%3e","",$input); $input=trim($input); return $input; } /**Validate an email address. Provide email address (raw input) Returns true if the email address has the email address format and the domain exists. */ function validEmail($email) { $isValid = true; $atIndex = strrpos($email, "@"); if (is_bool($atIndex) && !$atIndex) { $isValid = false; } else { $domain = substr($email, $atIndex+1); $local = substr($email, 0, $atIndex); $localLen = strlen($local); $domainLen = strlen($domain); if ($localLen < 1 || $localLen > 64) { // local part length exceeded $isValid = false; } else if ($domainLen < 1 || $domainLen > 255) { // domain part length exceeded $isValid = false; } else if ($local[0] == '.' || $local[$localLen-1] == '.') { // local part starts or ends with '.' $isValid = false; } else if (preg_match('/\\.\\./', $local)) { // local part has two consecutive dots $isValid = false; } else if (!preg_match('/^[A-Za-z0-9\\-\\.]+$/', $domain)) { // character not valid in domain part $isValid = false; } else if (preg_match('/\\.\\./', $domain)) { // domain part has two consecutive dots $isValid = false; } else if (!preg_match('/^(\\\\.|[A-Za-z0-9!#%&`_=\\/$\'*+?^{}|~.-])+$/', str_replace("\\\\","",$local))) { // character not valid in local part unless // local part is quoted if (!preg_match('/^"(\\\\"|[^"])+"$/', str_replace("\\\\","",$local))) { $isValid = false; } } } return $isValid; } $email = GetField($_GET['email']); $pass = validEmail($email); if ($pass) { $user_name = "_db"; $password = ""; $database = "_db"; $server = "localhost"; $db_handle = mysql_connect($server, $user_name, $password); $db_found = mysql_select_db($database, $db_handle); if ($db_found) { $SQL2 = "SELECT * FROM newsletter WHERE email = '$_GET[email]'"; $result = mysql_query($SQL2); mysql_close($db_handle); } if (strstr($SQL2,$email)) { echo 3; } else { $user_name = "_db"; $password = ""; $database = "_db"; $server = "localhost"; $db_handle = mysql_connect($server, $user_name, $password); $db_found = mysql_select_db($database, $db_handle); if ($db_found) { $SQL = "INSERT INTO newsletter (email,subscribed) VALUES ('$_GET[email]',1)"; $result = mysql_query($SQL); mysql_close($db_handle);} echo 1; } } else { echo 2; } ?> This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=332575.0 Hello Freaks! I am having problem with following code: <?php simplexml_load_string ('?xml version="1.0" encoding="utf-8"?>'); php?> This code is giving me following error Parse error: syntax error, unexpected '<' in public_html/wp-content/plugins/pluginnamehere/whatever.php on line 665 I know there is only a minor bracket problem that causing me this error. I would be helpful to you if you can modify it for me Thanks Hi guys and girls, I am having trouble finding out wether the query made no matches rather than just displaying the matches. So what I would want is for the search term to look at the database, and if there's not matches then say, "No match for your search term" Code: [Select] function search_applications() { global $dbc; echo '<form method="post" action="" id="search">'. "\n"; echo '<label for="search_applications">Search for an application</label>'. "\n"; echo '<input type="text" name="search_applications" />'. "\n"; echo '<input type="submit" name="submit" />'. "\n"; echo '</form>'. "\n"; if(isset($_POST['submit'])){ $search_applications = $_POST['search_applications']; if ($search_applications == "") { echo "<p>You forgot to enter a search term"; } //if (preg_match("/\b$search_applications\b/i")){ if(preg_match("/^[ a-zA-Z]+/", $search_applications)){ //for testing the variables //echo $search_applications; $sql="SELECT title, category, content FROM distributors_content WHERE title LIKE '%" . $search_applications . "%' OR category LIKE '%" . $search_applications ."%' OR content LIKE '%" . $search_applications ."%'"; $result=mysqli_query($dbc, $sql); //-create while loop and loop through result set while($row=mysqli_fetch_array($result)){ $title =$row['title']; $category=$row['category']; $content=$row['content']; //-display the result of the array echo "<ul>\n"; echo '<li> <a href="index.php?article='.$row['title'].'&&page=application" title=""> '.$title . ' ' . $category . '</a></li>'."\n"; echo "</ul>"; } }else{ echo "<p>Enter another search term</p>"; } } } Any pointers would be good Thank you $day = $_POST['day']; $month = $_POST['month']; $year = $_POST['year']; $date = date("Y-m-d", time(0,0,0,$month, $day, $year)); $sql="INSERT INTO child_info (first_name,middle_name,first_family_name,second_family_name, gender,birthdate,mother_living,father_living,brothers,sisters,resident_time,dorm,school,grade_level,school_subject,speak_english,food,medical_allergies,physical_limits,future,instrument,work,social,special_people,hobby,sponsor) VALUES ('$_POST[first_name]','$_POST[middle_name]','$_POST[first_family_name]','$_POST[second_family_name]','$_POST[gender]','$_POST[date]','$_POST[mother_living]','$_POST[father_living]','$_POST[brothers]','$_POST[sisters]','$_POST[resident_time]','$_POST[dorm]','$_POST[school]','$_POST[grade_level]','$_POST[school_subject]','$_POST[speak_english]','$_POST[food]','$_POST[medical_allergies]','$_POST[physical_limits]','$_POST[future]','$_POST[instrument]','$_POST[work]','$_POST[social]','$_POST[special_people]','$_POST[hobby]','$_POST[sponsor]')"; |