473,378 Members | 1,436 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Parse error: syntax error, unexpected T_VARIABLE in C:\wamp\www\job_detail.php on lin

This is my code..unexpected T_VARIABLE in C:\wamp\www\job_detail.php on line 15
Expand|Select|Wrap|Line Numbers
  1. <div class="h3">Features</div>
  2. <div class="mainbox">
  3. <ul id="features">
  4.  
  5. <?php
  6. $con = mysql_connect("localhost","root","");
  7. if (!$con)
  8.   {
  9.   die('Could not connect: ' . mysql_error());
  10.   }
  11.  
  12. mysql_select_db("job_seeks", $con);
  13.  
  14. $result = mysql_query("SELECT * FROM employer_user");
  15. $row = mysql_fetch_array($result);
  16.         ?>
  17. <center>
  18. <table cellspacing=1 cellpadding=5>
  19.         <tr><td class=listtitle colspan=2><center><span class='title2'></span></center></td></tr>
  20.         <?php
  21.         echo "
  22.         <form method=\"POST\">
  23.         <tr><td class=list align=left>Username</td><td class=list> ".$row['username']."<br></td></tr>
  24.         <tr><td class=list align=left>Business Name</td><td class=list> ".$row['business_name']."<br></td></tr></center>";
  25.         echo "</td></tr></table>";
  26. ?>
  27. </div>
  28. </div>
  29.  
  30.  
  31.  
  32.  
Dec 6 '11 #1
7 4649
omerbutt
638 512MB
hi aquilina,
what is on line number 15 , please paste the whole page job_detail.php here or copy paste the relevant code on that line.A wild guess is that above line number 15 , on line number 14 you are missing the semi-colon at the end of the php statement.
regards,
Omer Aslam
Dec 6 '11 #2
AutumnsDecay
170 100+
I believe the issue is that you're using "mysql_fetch_array". I could be wrong, but it's worth a shot.

Try using "mysql_fetch_assoc($result)". I see that you're using name keys ($row['username'], etc), which I believe is what an associative array (mysql_fetch_assoc) would return, whereas a standard 'fetch_array' returns a numerical key array.

Give it a shot and let me know.
Dec 6 '11 #3
omerbutt
638 512MB
hi AutmnsDecay ,
as far the definition of a mysql_fetch_array is concerned mysql_fetch_array — Fetch a result row as an associative array, a numeric array, or both so it wont make any difference until unless you specify as a parameter
Expand|Select|Wrap|Line Numbers
  1. mysql_fetch_array($result,MYSQL_NUM)
or
Expand|Select|Wrap|Line Numbers
  1. mysql_fetch_array($results,MYSQL_ASSOC)
regards,
Omer Aslam
Dec 6 '11 #4
AutumnsDecay
170 100+
Thanks for that, Omer.

Been a while since I've used PHP. Been enjoying Java & C++ for long enough to lose any potential knowledge, haha.
Dec 6 '11 #5
omerbutt
638 512MB
thats ok, java and c++ are the most interesting and HIGHLY PAYED tooo :D ;) , goodluck with that .
regards,
Omer Aslam
Dec 6 '11 #6
Dormilich
8,658 Expert Mod 8TB
and another cross-forum post …
Dec 7 '11 #7
Ammu
78
Expand|Select|Wrap|Line Numbers
  1. <div class="h3">Features</div>
  2. <div class="mainbox">
  3. <ul id="features">
  4.  
  5. <?php
  6. $con = mysql_connect("localhost","root","password");
  7. if (!$con)
  8. {
  9. die('Could not connect: ' . mysql_error());
  10. }
  11.  
  12. mysql_select_db("job_seeks", $con);
  13.  
  14. $result = mysql_query("SELECT * FROM employer_user");
  15. while($row = mysql_fetch_array($result))
  16. {
  17. ?>
  18. <center>
  19. <table cellspacing=1 cellpadding=5>
  20. <tr><td class=listtitle colspan=2><center><span class='title2'></span></center></td></tr>
  21. <?php
  22. echo "
  23. <form method=\"POST\">
  24. <tr><td class=list align=left>Username</td><td class=list> ".$row['username']."<br></td></tr>
  25. <tr><td class=list align=left>Business Name</td><td class=list> ".$row['business_name']."<br></td></tr></center>";
  26. echo "</td></tr></table>";
  27. }
  28. ?>
  29. </div>
  30. </div>
  31.  
Dec 11 '11 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Wescotte | last post by:
The error message Parse error: syntax error, unexpected $end in FILE on line X is one I run into frequently and I know the cause is I missed an ending quote. Is there an easy way to determine...
36
by: rhys | last post by:
My Gurus and Angels -- Please pardon this old-school programmer, only recently enlightened to open-source, having been trapped in the convenience of proprietary lingos for way too long. My...
3
by: SilvaZodiac | last post by:
Hi everyone, I'm still rather new to PHP code, and I have a syntax error. I've tried several different solutions, but it won't fix. It seems to suggest that I need a new bracket somewhere in the...
2
by: fburn | last post by:
I need some help with an error I'm getting using php 5.2.5 running on linux. I receive an error: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or...
9
akohistani
by: akohistani | last post by:
I am having Parse error problem with my newly purchased Php upload script I have uploaded the script and I get the error below Parse error: syntax error, unexpected $end in URL/functions.php on...
3
paulrajj
by: paulrajj | last post by:
hi to all, i am getting syntax error on my code.. Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in D:\xampp\htdocs\Dummy\paulraj\matrim\exam.php on line 62 ...
10
by: benicio | last post by:
Parse error: syntax error, unexpected T_STRING, expecting '(' in C:\wamp\www\study_group\includes\functions.php on line 19 I got this error and this syntax is from 8 to 19th line. <?php ...
3
by: brkseven | last post by:
Looking for help with this Contact Form. The error is on line 1, but that' doesn't mean a lot, I think. In fact, a php syntax check passed it, but I was hoping for an easy syntax error, it looks...
3
by: CYNTHIA CUTRER | last post by:
<!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" xml:lang="en"> <head> ...
2
by: Vicki Hendra | last post by:
Hi I am new to php fullstop I and colleagues have setup wordpress blogs for our local towns, giving the local businesses free advertisment. Part of the problem started when using wordpress...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.