NoMansLand Posted May 23, 2006 Share Posted May 23, 2006 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 59but 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 Quote Link to comment https://forums.phpfreaks.com/topic/10237-parse-error/ Share on other sites More sharing options...
trq Posted May 23, 2006 Share Posted May 23, 2006 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 Link to comment https://forums.phpfreaks.com/topic/10237-parse-error/#findComment-38159 Share on other sites More sharing options...
NoMansLand Posted May 23, 2006 Author Share Posted May 23, 2006 [!--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); ?> Quote Link to comment https://forums.phpfreaks.com/topic/10237-parse-error/#findComment-38160 Share on other sites More sharing options...
ober Posted May 23, 2006 Share Posted May 23, 2006 You'll want to use mysql_select_db() after mysql_connect(). Quote Link to comment https://forums.phpfreaks.com/topic/10237-parse-error/#findComment-38357 Share on other sites More sharing options...
NoMansLand Posted May 30, 2006 Author Share Posted May 30, 2006 [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 Quote Link to comment https://forums.phpfreaks.com/topic/10237-parse-error/#findComment-40144 Share on other sites More sharing options...
kenrbnsn Posted May 30, 2006 Share Posted May 30, 2006 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 Quote Link to comment https://forums.phpfreaks.com/topic/10237-parse-error/#findComment-40156 Share on other sites More sharing options...
NoMansLand Posted May 30, 2006 Author Share Posted May 30, 2006 ok last idiotic question..is there any tutorials on PHP to make it gowww.mysite.com/view.php?Date=DateThanks Kris [img src=\"style_emoticons/[#EMO_DIR#]/unsure.gif\" style=\"vertical-align:middle\" emoid=\":unsure:\" border=\"0\" alt=\"unsure.gif\" /] Quote Link to comment https://forums.phpfreaks.com/topic/10237-parse-error/#findComment-40169 Share on other sites More sharing options...
poirot Posted May 30, 2006 Share Posted May 30, 2006 I don't know exactly what you mean, but if you want to retrieve the value in the URL, use:$date = $_GET['Date']; Quote Link to comment https://forums.phpfreaks.com/topic/10237-parse-error/#findComment-40177 Share on other sites More sharing options...
NoMansLand Posted June 20, 2006 Author Share Posted June 20, 2006 i got another error on a search page but heres the whole scriptThis is the error im constantly gettingWarning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in C:\wamp\www\search.php on line 8Can\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());}?> Quote Link to comment https://forums.phpfreaks.com/topic/10237-parse-error/#findComment-47498 Share on other sites More sharing options...
poirot Posted June 20, 2006 Share Posted June 20, 2006 Change this:[code]$db_selected = mysql_select_db('TAC', $link);[/code]To[code]$db_selected = mysql_select_db('TAC', $connection);[/code] Quote Link to comment https://forums.phpfreaks.com/topic/10237-parse-error/#findComment-47500 Share on other sites More sharing options...
NoMansLand Posted June 20, 2006 Author Share Posted June 20, 2006 Last thing is their any tutorials/forums on search pages?if so can u show the link please (im also checking google!) Quote Link to comment https://forums.phpfreaks.com/topic/10237-parse-error/#findComment-47504 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.