mySQL and PHP search


Posted on 16th Feb 2014 07:03 pm by admin

Hello,
I am trying to code a project and ran into a brick wall with one of my pages. I am pretty new at php/mySQL and can not figure this out. Now I know that you are not going to sit there and type my whole script out for me. That is NOT what I am asking. I need pointers, links to tutorials, or whatever help you can get me. I appreciate it very much!

First off, I am recoding a site I created a little while ago in pure HTML to php. This site is a help wanted site and it has had massive amounts of hits and requests to put up listings. I have the pages to submit a listing, write that to the database, and one to show the results in a raw format. However, I am running into two problems. One is that I want to code the main page to just be a mysql query. This means that I want it to show just the company name and position available, then have a button to click to get the rest of the info about the job listing in a separate pop-up window. I can not seem to find code, tut or anything of the like about this.

Second problem, in my raw data results (plan table showing database contents) I need a link that will remove the entry. I have tried a couple of scripts and messed up my code further. I was wondering if anyone knows of something that describes this is great detail. It is all in a table.

Here is some of my code for the table with the DB contents:
Code: [Select]<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>View All Job Listings</title>
</head>

<body>
<?php

require 'dbconnect.inc';

mysql_select_db("coushatta", $con);


$result = mysql_query('SELECT * FROM jobs', $con);

echo "<table border='1'>
<tr>
<th>ID</th>
<th>Business Name</th>
<th>Contact Name</th>
<th>Phone Number</th>
<th>Fax Number</th>
<th>Email Address</th>
<th>Position Open</th>
<th>Open</th>
<th>Filled</th>
<th>Closed</th>
<th>Listing Content</th>
<th>Delete?</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['ID'] . "</td>";
echo "<td><a href='" . $row['ID'] . ".html'>" . $row['business_name'] . "</a></td>";
echo "<td>" . $row['contact_name'] . "</td>";
echo "<td>" . $row['phone_number'] . "</td>";
echo "<td>" . $row['fax_number'] . "</td>";
echo "<td>" . $row['email_address'] . "</td>";
echo "<td>" . $row['position_open'] . "</td>";
echo "<td>" . $row['learnmore'];

if ( $row['learnmore'] == TRUE ) {
echo "";
} else {
echo "";
}
"</td>";


echo "<td>" . $row['filled'];
if ( $row['filled'] == TRUE ) {
echo "";
} else {
echo "";
}"</td>";


echo "<td>" . $row['closed'];
if ( $row['closed'] == TRUE ) {
echo "";
} else {
echo "";
}"</td>";


echo "<td>" . $row['listing_content'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?>


</body>
</html>

No comments posted yet

Your Answer:

Login to answer
110 Like 25 Dislike
Previous forums Next forums
Other forums

Include ("Absolute Path") of a file?
I'm not sure what I'm doing wrong. I am writing my php code in the same directory of the file that

Undefined Variable: PHP_SELF, pls help
Hi,

Im a newbie on PHP / MySQL programming and Im running a script to search one field on my

Slashes
Have a small problem and I'm not able to understand why I'm getting the results I'm getting... and i

Why does first ever HttpSendRequest take longer?
I promise this isn't as simple as it sounds. I'm wondering why the the first ever call to HttpSendRe

max function question
Hi All
Ihave a table that holds shipment numbers and dates like this

select * from

HTML Form Server Side Validation
Hi, Im new here, im currently doing a website for a friend, and I have designed using snippets from

PHP5 - Verifying a secure mail is secure
I need to send an e-mail from a form to a external department and because it contains personal custo

FAGL_FC_TRANSLATION FAS52 New GL ECC 6.0
Hello,

The new program for Translating GL Balances (FAS 52) gives the option to use diffe

extract a file from zip file
hi,
i know how to unzip a zip file in php, but is there a way to just extract a certain file only

Problem with a select distinct
I have a problema with a select distinct, I have the next sql:

select distinct a,b,c,d fr

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash