Forum Statistics

  • Forum Members: 4,502
  • Total Threads: 3,657
  • Total Posts: 4
There are 1 users currently browsing forums.

Partner Sites

Reply
Old 01-18-2012, 10:03 AM   #1 (permalink)
RaschNuts
 
Status: Guest
Posts: n/a



Default PHP & MySQL Help

I keep getting this error. I am working through an assignment in a PHP MySQL book and new to this. If anyone could help that would be great.

I inserted dummy words for the password and host name for privacy reasons

Parse error: syntax error, unexpected T_VARIABLE in /home/content/21/8794321/html/report.php on line 26

<?php
$first_name = $_POST['firstname'];
$last_name = $_POST['lastname'];
$when_it_happened = $_POST['whenithappened'];
$how_long = $_POST['howlong'];
$how_many = $_POST['howmany'];
$alien_description = $_POST['aliendescription'];
$what_they_did = $_POST['whattheydid'];
$fang_spotted = $_POST['fangspotted'];
$email = $_POST['email'];
$other = $_POST['other'];

$dbc = mysqli_connect('hostname','owenfang1','password',' aliendatabase')
or die('Error connecting to MySQL server.')

$query = "INSERT INTO aliens_abduction (first_name, last_name, when_it_happened, how_long, " .
"how_many, alien_description, what_they_did, fang_spotted, other, email) " .
"VALUES ('$first_name', '$last_name', '$when_it_happened', '$how_long', '$how_many', " .
"'$alien_description', '$what_they_did', '$fang_spotted', '$other', '$email')";

$result = mysqli_query($dbc, $query)
or die('Error querying database.');

mysqli_close($dbc);

echo 'Thanks for submitting the form.<br />';
echo 'You were abducted ' . $when_it_happened;
echo ' and were gone for ' . $how_long . '<br />';
echo 'Number of aliens: ' . $how_many . '<br />';
echo 'Describe them: ' . $alien_description . '<br />';
echo 'The aliens did this: ' . $what_they_did . '<br />';
echo 'Was Fang there? ' . $fang_spotted . '<br />';
echo 'Other comments: ' . $other . '<br />';
echo 'Your email address is ' . $email;
?>
  Edit/Delete Message Reply With Quote
Old 01-18-2012, 06:46 PM   #2 (permalink)
eycamillewhitn
 
Status: Guest
Posts: n/a



Default

<strong><a href="http://www.alotofpandora.com/">cheap pandora</a></strong><br>
<strong><a href="http://www.alotofpandora.com/">buy pandora</a></strong><br>
<strong><a href="http://www.alotofpandora.com/pandora-sets-c-1.html">Pandora Sets</a></strong><br>
<strong><a href="http://www.alotofpandora.com/pandora-sets-c-1.html">Pandora Sets online</a></strong><br>
<strong><a href="http://www.alotofpandora.com/pandora-sets-c-1.html">Pandora Sets outlet</a></strong><br>
.<br />
<br />
Dependent on which state your house is in, the mortgage bank either details a Discover of Default (NOD) and files a judicial foreclosures lawsuit about the borrower.From the moment the home foreclosure is community information, it's relatively readily accessible.<br />
<br />
For that reason, depending what is the right property I'm focused on, I either instigate a search within the county courthouse or even I grab the information originating from a legal newspaper which includes done the trying to find me.<br />
<br />
The most difficult part is picking up a property having any equity involved.What I'm seeking out is a finance To Significance (LTV) with 80% or less.As an illustration, if a home has market value in $100, 000, the household can't owe beyond $75, 000 -$80, 000 relating to the property
  Edit/Delete Message Reply With Quote
Old 04-25-2012, 11:41 PM   #3 (permalink)
markjeff
 
Status: Guest
Posts: n/a



Post Re:

I've just started playing around with php and mysql. I'm trying to code a sort of inventory website for our school district. I've got pretty much everything working, such as pulling records by asset tag numbers, adding new records, pulling a report of serial numbers and the computer name, doing a checkin (basically putting an X in the checkin field). The only problem I'm having is on my update page.


Code:
<?php
include("dbinfo.inc.php");
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");

$term = $_POST['term'];
$sql = mysql_query("select * from Inventory where assettag = '$term' ");

while ($row = mysql_fetch_array($sql)){
echo '<br/> SerialNumber: '.$row['SerialNumber'];
echo '<br/> ComputerName: '.$row['ComputerName'];
echo '<br/><br/>';
}
?>

Code:
<form id="FormName" action="updated.php" method="post" name="FormName">
<table width="448" border="0" cellspacing="2" cellpadding="0">

<tr>
<td width="150" align="right"><label for="ComputerName">Computer Name</label></td>
<td><input name="ComputerNamenew" maxlength="" type="text" value="<?php echo $ComputerName ?>"></td>
</tr>

<tr>
<td width="150" align="right"><label for="SerialNumber">Serial Number</label></td>
<td><input name="SerialNumbernew" maxlength="" type="text" value="<?php echo $SerialNumber ?>"></td>
</tr>

<tr>
<td colspan="2" align="center"><input name="" type="submit" value="Update"></td>
</tr>

</table>
</form>
The first part works, and pulls the information I want. The part with the form doesn't work at all. I really don't even need the top part (the echoing part) if I could figure out the text boxes and have the mysql data show up in the boxes. Thanks for any help anyone can provide.
  Edit/Delete Message Reply With Quote
Old 05-02-2012, 05:43 AM   #4 (permalink)
onlinediscounte
 
Status: Guest
Posts: n/a



Default

<strong><a href="http://www.ilouboutinpumpssale.com/christian-louboutin-new-arrival-c-14.html ">Christian Louboutin New Arrival</a></strong><br>
<strong><a href="http://www.ilouboutinpumpssale.com/christian-louboutin-new-arrival-c-14.html ">buy christian louboutin</a></strong><br>
<strong><a href="http://www.ilouboutinpumpssale.com/christian-louboutin-new-arrival-c-14.html ">cheap christian louboutin</a></strong><br>
<strong><a href="http://www.ilouboutinpumpssale.com/christian-louboutin-new-arrival-c-14.html ">christian louboutin discount</a></strong><br>
<strong><a href="http://www.ilouboutinpumpssale.com/christian-louboutin-new-arrival-c-14.html ">christian louboutin replica</a></strong><br>
  Edit/Delete Message Reply With Quote


Reply

Bookmarks

Tags
None


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may post new threads
You may post replies
You may post attachments
You may edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.5.0 RC2