Jump to content

xanie

Members
  • Posts

    28
  • Joined

  • Last visited

Profile Information

  • Gender
    Female

xanie's Achievements

Member

Member (2/5)

0

Reputation

  1. can you help me with this one guys?? tnx.. <?php include("../../config/db.php"); $tableName="leave"; $targetpage ="index.php"; $limit = 10; $page = mysql_real_escape_string($_GET['page']); if($page){ $start = ($page - 1) * $limit; }else{ $start = 0; } $query = "SELECT COUNT(*) as num FROM $tableName "; $query1 = "SELECT * FROM $tableName ORDER BY l_id ASC LIMIT $start, $limit"; $total_pages = mysql_fetch_array(mysql_query($query)); $total_pages = $total_pages[num]; $stages = 3; // Get page data $result = mysql_query($query1) or die(mysql_error()); // Initial page num setup if ($page == 0){$page = 1;} $prev = $page - 1; $next = $page + 1; $lastpage = ceil($total_pages/$limit); $LastPagem1 = $lastpage - 1; ?> <table frame='box' rules='rows' align='center' width='100%' cellpadding="10px"> <tr bgcolor="#E8E7DA" style="border-width:5px;border-style:ridge;"> <th width='30px'></th> <th>L_id</th> <th>Type of Leave</th> <th>Date of Leave</th> <th>Name</th> <th>Position</th> <th>Year Hired</th> <th>Kind of Leave</th> <th>Reason</th> <th>Date Approval</th> <th width='30px'></th> </tr> <?php while($rows = mysql_fetch_array($result)) { $id = $rows['l_id']; $type = $rows['type_leave']; $d_leave = $rows['date_leave']; $name = $rows['name']; $position = $rows['position']; $year = $rows['year_hired']; $kind = $rows['kind_leave']; $reason = $rows['reason']; $approval = $rows['date_approval']; echo " <tr> <td><a href='edit_form.php?l_id=".$id."' style='color:red;font-size:11px;' onclick='return edit()'> EDIT</a></td> <td> ".$id."</td> <td> ".$type."</td> <td> ".$d_leave."</td> <td> ".$name."</td> <td> ".$position."</td> <td> ".$year."</td> <td> ".$kind."</td> <td> ".$reason."</td> <td> ".$approval."</td> <td><a href='delete.php?l_id=".$id."' style='color:red;font-size:11px;' onclick='return del()'>DELETE </a></td> </tr> "; } ?>
  2. I've check all the values but still it is unable to update mysql data.. help pls.. thanks a bunch.. mysql_query("UPDATE warranty SET date_purchased_month ='$month', date_purchased_day ='$day', date_purchased_year ='$year', full_name ='$fullname', address ='$address', city ='$city', email ='$email', gender ='$gender', age_group ='$agegroup', model ='$model', lens ='$lens', frame ='$frame', price_paid ='$ppaid', how_did_you_hear ='$how', where_did_you_buy ='$where', performance ='$performance', value ='$value', quality ='$quality', suggestions ='$suggestions' WHERE warranty_id ='$id'")or die(mysql_error("Unable to edit");
  3. <select name="lens"> <option value="Amber">Amber</option> <option value="Copper">Copper</option> <option value="Yellow">Yellow</option> <option value="Gray">Gray</option> <option value='Blue'>Blue Mirror</option> </select> <font size="2"> Frame: </font> <select name="frame"> <option value='Black'>Black</option> <option value='Sand'>Sand</option> <option value='Tortoise'>Tortoise</option> </select> i am trying to create two drop down menus: in blue mirror, the only available frame is black, how can i make in into a conditional statement wherein once you choose blue mirror the only option that will appear for frame is Black?? help me with this guys.. thanks.
  4. can u help me with this guys?? tnx.. $category = $_GET['category']; $search = $_GET['search']; $tableName="warranty"; $targetpage = "search.php"; $limit = 10; $page = mysql_real_escape_string($_GET['page']); if($page) { $start = ($page - 1) * $limit; } else { $start = 0; } if($category == 'id') { $query = "SELECT COUNT(*) as num FROM $tableName WHERE warranty_id = '$search'"; $query1 = "SELECT * FROM $tableName WHERE warranty_id = '$search' ORDER BY warranty_id ASC LIMIT $start, $limit"; } else if($category == 'name') { $query = "SELECT COUNT(*) as num FROM $tableName WHERE full_name = '$search'"; $query1 = "SELECT * FROM $tableName WHERE full_name like '%$search%' ORDER BY warranty_id ASC LIMIT $start, $limit"; } else { $query = "SELECT COUNT(*) as num FROM $tableName "; $query1 = "SELECT * FROM $tableName ORDER BY warranty ASC LIMIT $start, $limit"; } $total_pages = mysql_fetch_array(mysql_query($query)); $total_pages = $total_pages[num]; $stages = 3; // Get page data $result = mysql_query($query1); // Initial page num setup if ($page == 0){$page = 1;} $prev = $page - 1; $next = $page + 1; $lastpage = ceil($total_pages/$limit); $LastPagem1 = $lastpage - 1; ?> <?php $row_count = mysql_num_rows($result); if($row_count == 0 ) { echo " <tr> <td colspan='12' align='center'>No <font color='red'><b>'$search'</b></font> found. </td> </tr> "; } else { while($rows = mysql_fetch_array($result)) { $id = $rows['warranty_id']; $month = $rows['date_purchased_month']; $year = $rows['date_purchased_year']; $day = $rows['date_purchased_day']; $fullname = $rows['full_name']; $address = $rows['address']; $city = $rows['city']; $email = $rows['email']; $gender = $rows['gender']; $agegroup = $rows['age_group']; $model = $rows['model']; $lens = $rows['lens']; $frame = $rows['frame']; $ppaid = $rows['price_paid']; $how = $rows['how_did_you_hear']; $where = $rows['where_did_you_buy']; $performance= $rows['performance']; $value = $rows['value']; $quality = $rows['quality']; $suggestions= $rows['suggestions']; $date_activation=$rows['date_of_activation']; echo " <tr> <td><a href='/warranty/edit/?warranty_id=".$id."' onclick='return edit()'> EDIT</a></td> <td> ".$id."</td> <td> ".$month."</td> <td> ".$day."</td> <td> ".$year."</td> <td> ".$fullname."</td> <td> ".$address."</td> <td> ".$city."</td> <td> ".$email."</td> <td> ".$gender."</td> <td> ".$agegroup."</td> <td> ".$model."</td> <td> ".$lens."</td> <td> ".$frame."</td> <td> ".$ppaid."</td> <td> ".$how."</td> <td> ".$where."</td> <td> ".$performance."</td> <td> ".$value."</td> <td> ".$quality."</td> <td> ".$suggestions."</td> <td> ".$date_activation." </td> <td><a href='/quotations/delete/?warranty_id=".$id."' style='color:red' onclick='return del()'>DELETE </a></td> </tr> "; } } ?>
  5. wat if i'm going to insert this on mysql using codings on php.. ("INSERT INTO register( first_name, last_name, address, specialization, gender, birthday, contact_num, email_add, password ) VALUES( '$first', '$last', '$add', '$options', '$gender', '$birthdate', '$contact', '$email', '$pass'
  6. I have just installed WAMP earlier.. The setup went well and localhost seems to work, but when I try to access my webpage I get this error: "Forbidden You don't have permission to access/ on this server." Why do I get this permission access error with wamp? Are there tutorials/guides that would explain this problem? I am using Windows 7 home premium 32 can help me guys? thanks.
  7. here is the problem sir, when i was uploading an image it appears in the sql as null, meaning it wasn't able to get the value of photo.
  8. can u locate the error? thanks.. itcouldn't able to save photos on sql.. <?php if(isset($_POST['submit'])) { $title = $_POST['title']; $details = $_POST['details']; $month = $_POST['Month']; $day= $_POST['Day']; $year= $_POST['Year']; $date= "$month $day,$year"; $image=$_POST['image']; if(!empty($_FILES['image']['name'])) { $fileName = $_FILES['image']['name']; $tmpName = $_FILES['image']['tmp_name']; $fileSize = $_FILES['image']['size']; $fileType = $_FILES['image']['type']; $fp = fopen($tmpName, 'r'); $content = fread($fp, filesize($tmpName)); $content = addslashes($content); fclose($fp); if(!get_magic_quotes_gpc()) { $fileName = addslashes($fileName); } } else { $content = "NULL"; $fileName = "NULL"; $fileType = "NULL"; } } mysql_query ("INSERT INTO newsandevents( date, details, title, photo, photo_name, photo_file_type ) VALUES( '$date', '$details', '$title' , '$content', '$fileName', '$fileType')") or die(mysql_error()); header('location:../News2.php'); print '<script type="text/javascript">'; print 'alert("Successfully added!")'; print '</script>'; ?>
  9. i think my looping statement is correct but how come that I'm encountering such error. <?php session_start(); include("../config/db.php"); if(isset($_POST['log-in'])) { $email =$_POST['email_add']; $pass =$_POST['password']; $password = mysql_real_escape_string($pass); $email_ = mysql_real_escape_string($email); $result=mysql_query("Select * from register where email_add='$email' and password='$pass'")or die(mysql_error()); $user=mysql_num_rows($result); if ($user == 0 ) { echo "Invalid username or password"; } else if($user==1) { while($rows(mysql_fetch_array($result)) { $id =$rows['reg_id']; $email =$rows['email_add']; $pass =$rows['password']; $_SESSION['reg_id'] =$id; $_SESSION['email_add'] = $email; $_SESSION['password'] =$pass; header('location:index.php'); } } else { echo "Error!"; } } ?>
  10. yes, i do have.. it's mail.genasiabiotech.com, i've already put this in my smtp still, it didn't work out
×
×
  • 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.