Jump to content

Parse Error


NoMansLand

Recommended Posts

Yes i am new to PHP and SQL but im incorporation PHP, SQL and HTML all together about 2 minutes ago the site worked now it comes up with:

Parse error: parse error, unexpected $end in C:\wamp\www\Test\test2.php on line 59


but their is no line 59, im using Notepad and PHP editor 2.22 the lines are
(top)
<?php
$date = $_POST["date"];
$manager = $_POST["manager"];
$Category = $_POST["Category"];
$quote = $_POST["quote"];
if (!isset($_POST['submit']))
?>

(bottom)
</select>
</option>
<form>
<textarea rows="10" cols="90" name="quote" wrap="physical">Please insert decision inside here.</textarea><br />
<input type="submit" value="submit" name="submit"> </input>
</form>
</body>
</html>

chears

Kris
Link to comment
Share on other sites

[!--quoteo(post=376248:date=May 23 2006, 02:40 PM:name=thorpe)--][div class=\'quotetop\']QUOTE(thorpe @ May 23 2006, 02:40 PM) [snapback]376248[/snapback][/div][div class=\'quotemain\'][!--quotec--]
My guess is your if() is missing either a { or }. Bit hard to tell without seeing the actual code. Is that all of it?
[/quote]
Nope... i fixed it but :)

now i gotta do the SQL and the view.php?Date=ddmmyy *wonders*

just how do i make it connect to the database??

i have (this is not mine, i just re-wrote it so i can learn it..)

<td><?php include 'caseswitch.php'; ?></td> (index.php)

<?PHP
$conn=mysql_connect(localhost, ****, ******) (caseswitch.php)
$query = "SELECT tac, date ";
$query .= "FROM tac";
$query .= "WHERE date=". $_GET['date'];

mysql_query($query);
?>
Link to comment
Share on other sites

[img src=\"style_emoticons/[#EMO_DIR#]/unsure.gif\" style=\"vertical-align:middle\" emoid=\":unsure:\" border=\"0\" alt=\"unsure.gif\" /]

well i just put in

<?PHP
$conn=mysql_connect(localhost, ****, ******) //(caseswitch.php)
[b]$query = mysql_select_db(tac)[/b]
$query = "SELECT tac, date ";
$query .= "FROM tac";
$query .= "WHERE date=". $_GET['date'];

mysql_query($query);
?>

i had: $conn=mysql_select_db(tac) but they have both come up with

Parse error: parse error, unexpected T_VARIABLE in [a href=\"http://localhost/test/caseswitch.php\" target=\"_blank\"]http://localhost/test/caseswitch.php[/a] on line 3
Link to comment
Share on other sites

You're missing the terminating semi-colon on two of your lines. All complete statements [b][!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]MUST[!--colorc--][/span][!--/colorc--][/b] end with a semi-colon (almost) -- the only exception is if the statement is the last one before the closing "?>" tag.

Add the semi-colon on these two lines:
[code]<?PHP
$conn=mysql_connect(localhost, ****, ******); //<-- semi-colon added
$query = mysql_select_db(tac);  // <-- semi-colon added
?>[/code]

Ken
Link to comment
Share on other sites

ok last idiotic question..

is there any tutorials on PHP to make it go

www.mysite.com/view.php?Date=Date


Thanks Kris [img src=\"style_emoticons/[#EMO_DIR#]/unsure.gif\" style=\"vertical-align:middle\" emoid=\":unsure:\" border=\"0\" alt=\"unsure.gif\" /]
Link to comment
Share on other sites

  • 3 weeks later...
i got another error on a search page but heres the whole script

This is the error im constantly getting

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in C:\wamp\www\search.php on line 8
Can\t use TAC :

<?php
$host = "localhost";
$user = "****";
$pass = "******";
$dbname = "TAC";
$connection = mysql_connect($host,$user,$pass) or die (mysql_errno().": ".mysql_error()."<BR>");

$db_selected = mysql_select_db('TAC', $link);
$date = $_GET["date"];
$manager = $_GET["manager"];
$Category = $_GET["Category"];
$quote = $_GET["quote"];
if (!isset($_POST['submit']))
if (!$db_selected) {
die ('Can\t use TAC : ' . mysql_error());
}
?>
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.