magnetica Posted February 25, 2007 Share Posted February 25, 2007 Good Good.. Only having a laugh Not a relevant place to put this.. but is there anywhere that tells when your title e.g. Noobie, NonSpammer, Forum Helper goes up when you have enough posts Link to comment https://forums.phpfreaks.com/topic/39979-solved-urgently-need-help-php-link/page/3/#findComment-193928 Share on other sites More sharing options...
Yesideez Posted February 25, 2007 Share Posted February 25, 2007 Not that I've found but then I've not looked. ow-design: What are the field names for the job title and description? Link to comment https://forums.phpfreaks.com/topic/39979-solved-urgently-need-help-php-link/page/3/#findComment-193931 Share on other sites More sharing options...
ow-design Posted February 25, 2007 Author Share Posted February 25, 2007 job title is name description is description thanks! Link to comment https://forums.phpfreaks.com/topic/39979-solved-urgently-need-help-php-link/page/3/#findComment-193933 Share on other sites More sharing options...
Yesideez Posted February 25, 2007 Share Posted February 25, 2007 Try this but don't forget to edit the SELECT call for your table data! <?php include("db.php"); // Get a connection to the database $jobid=$_GET['id']; $cxn = @ConnectToDb($dbServer, $dbUser, $dbPass, $dbName); <table width="600" border="0">; <?php if (is_numeric($jobid)) { $sql="SELECT * FROM jobs WHERE `jobid`='$jobid'"; $fetch=mysql_fetch_assoc(mysql_query($sql)); echo '<tr><td><strong>Job title:</strong></td><td>'.$fetch['name'].'</td></tr>'; echo '<tr><td><strong>Details:</strong></td><td>'.$fetch['description'].'</td></tr>'; } else { echo '<tr><td>I am unable to locate that job - sorry!</td></tr> } ?> </table> </html> Link to comment https://forums.phpfreaks.com/topic/39979-solved-urgently-need-help-php-link/page/3/#findComment-193935 Share on other sites More sharing options...
ow-design Posted February 26, 2007 Author Share Posted February 26, 2007 okay new error on jobdetails.php Parse error: syntax error, unexpected '<' in /home/deswo/public_html/clients/martin_pooley/jobdetails.php on line 11 line 11 is: <table width="600px"> [/code Link to comment https://forums.phpfreaks.com/topic/39979-solved-urgently-need-help-php-link/page/3/#findComment-193938 Share on other sites More sharing options...
Yesideez Posted February 26, 2007 Share Posted February 26, 2007 Oops! <?php include("db.php"); // Get a connection to the database $jobid=$_GET['id']; $cxn = @ConnectToDb($dbServer, $dbUser, $dbPass, $dbName); ?> <table width="600" border="0"> <?php if (is_numeric($jobid)) { $sql="SELECT * FROM jobs WHERE `jobid`='$jobid'"; $fetch=mysql_fetch_assoc(mysql_query($sql)); echo '<tr><td><strong>Job title:</strong></td><td>'.$fetch['name'].'</td></tr>'; echo '<tr><td><strong>Details:</strong></td><td>'.$fetch['description'].'</td></tr>'; } else { echo '<tr><td>I am unable to locate that job - sorry!</td></tr> } ?> </table> </html> Link to comment https://forums.phpfreaks.com/topic/39979-solved-urgently-need-help-php-link/page/3/#findComment-193942 Share on other sites More sharing options...
Archadian Posted February 26, 2007 Share Posted February 26, 2007 In the code i gave you all you have to do is make a table to show the details on jobdetails.php and in the mysql_query() you have to put the name of the columns and the name of the table where the info on the jobs are. When i said my code wouldn't work i meant you have to put in the correct table names Link to comment https://forums.phpfreaks.com/topic/39979-solved-urgently-need-help-php-link/page/3/#findComment-193946 Share on other sites More sharing options...
ow-design Posted February 26, 2007 Author Share Posted February 26, 2007 next prob? cant figure it out?? Parse error: syntax error, unexpected $end in /home/deswo/public_html/clients/martin_pooley/jobdetails.php on line 23 line 27 reads: </html> Link to comment https://forums.phpfreaks.com/topic/39979-solved-urgently-need-help-php-link/page/3/#findComment-193951 Share on other sites More sharing options...
Yesideez Posted February 26, 2007 Share Posted February 26, 2007 I forgot to terminate an echo... echo '<tr><td>I am unable to locate that job - sorry!</td></tr>'; This happens when tired lol Link to comment https://forums.phpfreaks.com/topic/39979-solved-urgently-need-help-php-link/page/3/#findComment-193954 Share on other sites More sharing options...
ow-design Posted February 26, 2007 Author Share Posted February 26, 2007 thanks!!, is working now, but when i click link from jobs.php the jobdetails.php just says unable to find job. Sorry to keep you awake. Ollie Link to comment https://forums.phpfreaks.com/topic/39979-solved-urgently-need-help-php-link/page/3/#findComment-193956 Share on other sites More sharing options...
Yesideez Posted February 26, 2007 Share Posted February 26, 2007 Edit this line in the first script from this: <a href="jobdetails.php?<?php echo $fetch["id"]?>">More About Vacancy</a></font></td> to this: <a href="jobdetails.php?id=<?php echo $fetch["id"]?>">More About Vacancy</a></font></td> My mistake again! Link to comment https://forums.phpfreaks.com/topic/39979-solved-urgently-need-help-php-link/page/3/#findComment-193957 Share on other sites More sharing options...
ow-design Posted February 26, 2007 Author Share Posted February 26, 2007 ok, looking better but am geting following message: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/deswo/public_html/clients/martin_pooley/jobdetails.php on line 15 [b]Job title: Details: [/b] line 15 reads: $fetch=mysql_fetch_assoc(mysql_query($sql)); Link to comment https://forums.phpfreaks.com/topic/39979-solved-urgently-need-help-php-link/page/3/#findComment-193962 Share on other sites More sharing options...
Archadian Posted February 26, 2007 Share Posted February 26, 2007 shouldn't it be this: $fetch=mysql_fetch_assoc($sql); Link to comment https://forums.phpfreaks.com/topic/39979-solved-urgently-need-help-php-link/page/3/#findComment-193964 Share on other sites More sharing options...
Yesideez Posted February 26, 2007 Share Posted February 26, 2007 You'll often find that the error often lies in a previous line or two before the line you get told it's in. As I said earlier, the error is actually in the line that assigns the variable $sql the SELECT call - change it to suit your database. Link to comment https://forums.phpfreaks.com/topic/39979-solved-urgently-need-help-php-link/page/3/#findComment-193965 Share on other sites More sharing options...
Yesideez Posted February 26, 2007 Share Posted February 26, 2007 shouldn't it be this: $fetch=mysql_fetch_assoc($sql); Sort of but we need to go one line before that because the SELECT call itself is wrong. ow-design hasn't changed it to suit his database and has used the default one I posted as an example. Link to comment https://forums.phpfreaks.com/topic/39979-solved-urgently-need-help-php-link/page/3/#findComment-193967 Share on other sites More sharing options...
magnetica Posted February 26, 2007 Share Posted February 26, 2007 ow-design try this: mysql_query($sql); $fetch=mysql_fetch_assoc($sql); Tell if it works or not Link to comment https://forums.phpfreaks.com/topic/39979-solved-urgently-need-help-php-link/page/3/#findComment-193968 Share on other sites More sharing options...
magnetica Posted February 26, 2007 Share Posted February 26, 2007 Well lets take a look at the SELECT statement then Post it on here Link to comment https://forums.phpfreaks.com/topic/39979-solved-urgently-need-help-php-link/page/3/#findComment-193969 Share on other sites More sharing options...
ow-design Posted February 26, 2007 Author Share Posted February 26, 2007 Fantastic!!! got it to work.!!! Thankyou so much to everyone who has helped me!!! ESPECIALLY Yesideez !! Really appreciate it!!! Really Happy now:) Link to comment https://forums.phpfreaks.com/topic/39979-solved-urgently-need-help-php-link/page/3/#findComment-193972 Share on other sites More sharing options...
Yesideez Posted February 26, 2007 Share Posted February 26, 2007 I'm glad to hear it! You're just in time as I've got 8 minutes left as well Link to comment https://forums.phpfreaks.com/topic/39979-solved-urgently-need-help-php-link/page/3/#findComment-193973 Share on other sites More sharing options...
ow-design Posted February 26, 2007 Author Share Posted February 26, 2007 Thanks for being so kind ! good night! Link to comment https://forums.phpfreaks.com/topic/39979-solved-urgently-need-help-php-link/page/3/#findComment-193981 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.