Jump to content

slickboyj

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

slickboyj's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I'm have 2 issues with this function I've wrote. 1. I have a counter that counts how records = dept_id and no matter which dept_id I choose, I'm minus one, the count. example. It says I have (5) items but only display's (4) 2. I've been trying to wrap my head around this logic. How do I write out. If dept_id is set the run sql_query (a) if it isn't then run sql_query (b). <-- so far I've got this part. If dept_id has a variable, display the records. But if dept_id doesn't exist then display " does not exist" <----the part i'm having trouble with. I hope the following code helps <h3>Catergory</h3> <ul class="sidemenu"> <li><a href="new_stuff_cat.php?dept_id=1000">******</a></li> <li><a href="new_stuff_cat.php?dept_id=1500">******</a></li> <li><a href="new_stuff_cat.php?dept_id=2000">******</a></li> <li><a href="new_stuff_cat.php?dept_id=2500">******</a></li> <li><a href="new_stuff_cat.php?dept_id=3000">******</a></li> <li><a href="new_stuff_cat.php?dept_id=3500">******</a></li> <li><a href="new_stuff_cat.php?dept_id=3600">******</a></li> <li><a href="new_stuff_cat.php?dept_id=4000">******</a></li> <li><a href="new_stuff_cat.php?dept_id=4500">******</a></li> <li><a href="new_stuff_cat.php?dept_id=5000">******</a></li> <li><a href="new_stuff_cat.php?dept_id=5500">******</a></li> <li><a href="new_stuff_cat.php?dept_id=6000">******</a></li> <li><a href="new_stuff_cat.php?dept_id=6500">******</a></li> <li><a href="new_stuff_cat.php?dept_id=6600">******</a></li> <li><a href="new_stuff_cat.php?dept_id=7000">******</a></li> <li><a href="new_stuff_cat.php?dept_id=7500">******</a></li> <li><a href="new_stuff_cat.php?dept_id=8000">******</a></li> <li><a href="new_stuff_cat.php?dept_id=8500">******</a></li> <li><a href="new_stuff_cat.php?dept_id=9000">******</a></li> <li><a href="new_stuff_cat.php?dept_id=9500">******</a></li> <li><a href="new_stuff_cat.php?dept_id=9999">******</a></li> </ul> </div> <!-- end of left siide menu--> <!-- Start of main ..middle.. content--> <div id="main"> <?php product_cat_listing_a(); ?> </div> </div> ------------------------------------------------------------------ function product_cat_listing_a(){ require("includes/******"); $conn = mysql_connect(SQL_HOST, SQL_USER, SQL_PASS) or die ('Could not connect to MySQL. ' .mysql_error()); mysql_select_db(SQL_DB, $conn) or die (mysql_error()); // get the dept_id being passed by the link $dept_id= $_REQUEST['dept_id']; // if dept_id is NOT empty or if dept_id has a variable run the sql query 'find everything that equals the DEPT_ID' if(!empty($dept_id)){ $sql = "SELECT * FROM products_2008 WHERE dept_id = '$dept_id' ORDER BY product_id LIMIT 0, 800"; // If dept_id is EMPTY ' hasn't been set' then list everything in a random order }else{ $sql = "SELECT * FROM products_2008 ORDER BY RAND() LIMIT 0, 800"; } $result = mysql_query($sql) or die (mysql_error()); $count = mysql_num_rows($result) or die (mysql_error()); mysql_close(); $row = mysql_fetch_array($result) or die (mysql_error()); //if $dept_id is set then display the results if(isset($row['dept_id'])){ echo "<table class='product_list'> <tr> <td colspan='2'> <br /> <br />Department ID: $dept_id - ($count) items</td> </tr>"; // displaying the results of dept_id while($row = mysql_fetch_array($result)) { $sku_number = $row['product_sku_number']; // set the path to the photos $product_photo = "buyers/images/products/".$row['product_photo'].""; $model_number = $row['product_model_number']; // get price and format it $number = $row['product_retail_price']; $formatted = number_format($number); if (($i % 4) == 0) { echo "<tr>"; } echo "<td valign='top' id='top_line'> <table class='product_listings'> <tr> <td><img src='$product_photo' width='100' border='0'/></td> </tr> <tr> <td> <a href='product_detail.php?id=".$row['product_id']."'><p class='title'><strong>".$row['product_name']."</strong></a> <p>SKU:$sku_number</p> <p>Price: $ $number</p> </td> </tr> </table> </td>"; if (($i % 2) == 2) { echo "</tr>"; } $i++; } echo "</tr> </table>"; } else { echo "<table class='product_list'> <tr> <td colspan='2'> <br /> <br />Department ID: $dept_id - ($count) items</td> </tr> <td valign='top' id='top_line'> <table class='product_listings'> <tr> <td>No Items to be displayed</td> </tr> <tr> <td></td> </tr> </table> </td> </tr> </table>"; } } Thanks for viewing.
  2. I'm afraid to show my code right now. its soooo all over the place. But I do belive I want to store the the sort in the $_sessions. I'll read up on that. thanks
  3. I'd like to be able to let a user sort a table of date by example "Last Name" and when the user goes back the page it'll remember to sort by "Last name" thanks Joe
  4. The text sound like a lead. It does make sense why its bringing up the garbled message. Here is part of the code I belive may have clues. .style12 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; } .style14 {font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size: 14px; } /............/ $id = $_GET['id']; $sql = "SELECT * FROM employment_resume WHERE id='$id'"; $result = mysql_query($sql) or die (mysql_error()); $row = mysql_fetch_array($result); if (!is_array($row)) { echo "Opps! Nothing to confirm. Please contact your administrator"; exit; } $to=$_POST['emailaddress']; $to .=$_POST['emailaddress2']; /* Get the form date from the variable $_POST which stores everything from the form since the method of the form is post if it was get you would use $_GET instead of $_POST. You can reference it directly e.g. $email but it may not work because the setting register_globals is off by default which means you have to use $_POST or $_GET to access form data */ //add From: header $headers = "From: Human Resources\r\n"; //specify MIME version 1.0 $headers .= "MIME-Version: 1.0\r\n"; //unique boundary $boundary = uniqid("HTML"); //tell e-mail client this e-mail contains//alternate versions $headers .= "Content-Type: multipart/alternative" . "; boundary = $boundary\r\n\r\n"; //message to people with clients who don't //understand MIME $headers .= "This is a MIME encoded message.\r\n\r\n"; //plain text version of message $headers .= "--$boundary\r\n" . "Content-Type: text/plain; charset=ISO-8859-1\r\n" . "Content-Transfer-Encoding: base64\r\n\r\n"; $headers .= chunk_split(base64_encode("This is the plain text version!")); //HTML version of message $headers .= "--$boundary\r\n" . "Content-Type: text/html; charset=ISO-8859-1\r\n" . "Content-Transfer-Encoding: base64\r\n\r\n"; $headers .= chunk_split(base64_encode("")); $from = 'Human Resourses'; $message = '<b>ONLINE RESUME</b><br><br><br>'; $message .="<HTML><BODY> <table width='700' border='0' cellpadding='0' cellspacing='3' bgcolor='#FFFFFF'> <tr> <td colspan='5' bgcolor='#CCCCCC'><div align='left' class='style14'>Personal Information </div></td> </tr> <tr> <td colspan='5' bgcolor='#FFFFFF'><input type='hidden' name='$id'></td> </tr> <tr> <td bgcolor='#FFFFFF'> </td> <td bgcolor='#FFFFFF' class='style12'> </td> <td colspan='3' bgcolor='#FFFFFF'> </td> </tr> <tr> <td bgcolor='#FFFFFF'> </td> <td bgcolor='#FFFFFF' class='style12'><div align='left'>First Name:</div></td> <td colspan='3' bgcolor='#FFFFFF'><div align='left' class='style16'>".$row['first_name']."</div></td> </tr> <tr> <td bgcolor='#FFFFFF'> </td> <td bgcolor='#FFFFFF' class='style12'><div align='right' class='style12'> <div align='left'>Last Name: </div> </div></td> <td colspan='3' bgcolor='#FFFFFF'><div align='left' class='style16'>".$row['last_name']."</div></td> </tr> <tr> <td bgcolor='#FFFFFF'> </td> <td bgcolor='#FFFFFF' class='style12'><div align='left'>Home Address: </div></td> <td colspan='3' bgcolor='#FFFFFF'><div align='left' class='style16'>".$row['home_address'] .................... </table> /........./ $subject=$_POST['subject']; $submit=$_POST['submit']; if(mail($to,$subject,$message,$headers)){ echo "Resume was successfully Sent"; }else{ echo "Resume Sending Failed"; } I hope this helps.
  5. Is it possible and if so any suggestions would be appreciated. I've created a page the pulls data from a mysql DB using the PHP mail() function. The data being displayed in the page can be emailed with a form on the same page. The form works when sending to a PC but the problem is that when the MySQL / PHP data is sent to a blackberry this comes up in the 'message' looking like this. lãK Ñ%öÛ­ºÛ¬tÌ,ƒbÖ›•ì"vØïM¢·¬ziµ×(–ÊZœ Ê¢jþ×mu¸¢Z+QEQ]Šö¥Š ®(µÉ²·×½v+Ú–('WŸµ+ZµïÝŠÿÝŠÿív×[Ê%¢°QØjXœ~®²rµÖàr‰h¬Qv+–(W·÷¿ûµÖr‰¬v–·¿þ® My question is does blackberry's OS understand PHP? I don't have access to the blackberrys. I need to do this on the html/server side. thanks Joe
  6. This is my php code Code: $sql = "SELECT * FROM employment_resume WHERE delete=1 ORDER BY last_name ASC"; and the error I'm receiving is: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delete='1' ORDER BY last_name ASC' at line 1 any help would great. J
  7. Good Afternoon, $conn = mysql_connect(SQL_HOST, SQL_USER, SQL_PASS) or die ('Could not conncect to MySQL. ' .mysql_error()); mysql_select_db(SQL_DB, $conn) or die (mysql_error()); $id = $_REQUEST["product_id"]; $publish = $_REQUEST["publish"]; $sql = "UPDATE products SET publish = 0 WHERE publish = $publish"; $result = mysql_query($sql) or die (mysql_error()); mysql_close(); What I'm trying to to is update publish from a 1 to 0 Nothing is updating at all and I'm at a point where I'm gonna go bananas. Any help would be great. Thanks, Joe
  8. I guess what I'm confused with is how do I do use the mailto to mail multiple data fields. example.. name_______ town________ state_________ p.number___________ field1_______________ field2_______________ field.......................... field15_______________ I would like to have all the field data parsed to the email body. I'm not understanding where the variables for the fields are put in the php code. I'm sorry, if I'm not explaining it properly. but I'm a lil confused still. Thank for help. Joe
  9. Good Morning All, I'm trying to edit a email form that is about 30+ fields. Right now the form only inserts the data to a MySQL DB. What I would like to add is an email (mailto) feature that sends the entered data from the form to an email address as well as add it to the DB at the same time. I'm not a beginner in PHP MySQL but not quite a novice just yet. Any suggestions or articles would be great appreciated. Thanks Joe
×
×
  • 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.