Jump to content

[SOLVED] Urgently need help!! PHP Link


ow-design

Recommended Posts

  • Replies 69
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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
Share on other sites

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
Share on other sites

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
Share on other sites

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
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.