|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today! |
|
#1
|
||||
|
||||
|
Will work for beer money
I just finished a long term PHP coding gig and I'm looking for work. Share the love.
|
|
#2
|
|||
|
|||
|
RE: Will work for beer money
Well I can't pay much... but if you can add pagation to this search I'll pay you $25.
[div id="search" style="position:absolute; width:660px; height:115px; z-index:1; left: 29px; top: 244px;"] [highlight=php] $rs=mysql_connect ("localhost", "x", "x") or die ('I cannot connect to the database because: ' . mysql_error()); $rs=mysql_select_db ("x"); $sql = "SELECT * FROM `jobs` WHERE 1 "; if (!empty($_POST['keyword'])){ $keyword = $_POST['keyword']; $sql .= " AND keyword LIKE '%$keyword%' "; } if (!empty($_POST['city']) ){ $city = $_POST['city']; $sql .= " AND city='$city' "; } if (!empty($_POST['state'] ) ){ $state = $_POST['state']; $sql .= " AND state='$state' "; } if (!empty($_POST['catagory'])){ $catagory = $_POST['catagory']; $sql .= " AND job='$catagory' "; } if (mysql_errno != 0){ echo "Error in query. Error is: " .mysql_error(); die(); } $rs = @mysql_query($sql); if(mysql_num_rows($rs) == 0){ echo("No Data match!"); } $bgcolor = "#E0E0E0"; // light gray while ($row = mysql_fetch_array( $rs ) ) { if ($bgcolor == "#E0E0E0"){ $bgcolor = "#ffffcc"; }else{ $bgcolor = "#E0E0E0"; } ?> <div id="results" > <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr bgcolor="<?php echo $bgcolor; ?>"> <td width="30%" align="center"><?php echo $row['keyword']; ?></td> <td width="30%" align="center"><?php echo $row['city']; ?></td> <td width="10%" align="center"><?php echo $row['state']; ?></td> <td width="30%" align="center"><?php echo $row['job']; ?></td> </tr> </table></div><?php } ?></div> |
|
#3
|
|||||
|
|||||
|
RE: Will work for beer money
lol, is that open to all?
php Code:
|
|
#4
|
|||
|
|||
|
Message Moved
Thread moved from 'PHP Coding' to 'Barter Zone' by tkarkkainen.
Reason: |
|
#5
|
||||
|
||||
|
RE: Will work for beer money
MySQL is looking for web developers - worldwide.
http://www.mysql.com/company/jobs/webdeveloper.html Always good to know what is out there. *sigh* I'd apply but all my stuff is intranet so no URLS |
|
#6
|
|||
|
|||
|
RE: Will work for beer money
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/x/public_html/x/searchwithpaging.php on line 75
I am getting this message. What should i do? |
|
#7
|
||||
|
||||
|
RE: Will work for beer money
I can't see your code, hopefully you changed the code to match your table etc.
first you should get rid of the @ sign on your query it suppresses errors. echo your query when it's complete so you can see if it has the proper query you're expecting. you may be getting 0 results, or else you may be having trouble with mysql_num_rows() I have had this kind of problem in the past. It's not always clear to me why this function fails at certain times. |
|
#8
|
|||
|
|||
|
RE: Will work for beer money
the query is fine... It is running and working well on another page. The mysql_num_rows()works as well on other searches...so.. I will try and figure it out...if I have anymore questions I'll send them.
I will send the money either tonight or tomorrow..no problem I have to become a member of pay pal still. Thanks for your help |
|
#9
|
||||
|
||||
|
RE: Will work for beer money
if you want to test the pagination code you can switch to adding a second query.
use the first query "SELECT count(id) AS entries FROM table WHERE blah blah blah "; to get the same results as mysql_num_rows() and you'll see that the pagination works. |
|
#10
|
|||
|
|||
|
RE: Will work for beer money
the code isnt working... I have been working on it for a while. have any more suggestions?
|