Jump to content

Search the Community

Showing results for tags 'mysql'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

  1. im working on a project but first i would to understand one thing. i have 2 input type text field with name="firstname[]" as an array (in the example im working with no jquery but it will be generated dinamically with it) and cant make it to mysql. here is what i have: index.php <html> <body> <form action="insert.php" method="post"> Firstname: <input type="text" name="firstname[]"> <br> Firstname 2: <input type="text" name="firstname[]"> <input type="submit"> </form> </body> </html> insert.php <?php $con=mysqli_connect("localhost","inputmultiplicad","inputmultiplicado","inputmultiplicado"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $sql="INSERT INTO input_field (firstname) VALUES ('$_POST[firstname]')"; if (!mysqli_query($con,$sql)) { die('Error: ' . mysqli_error($con)); } echo "1 record added"; mysqli_close($con); ?> the question is: how can i send the firstname[] array to the mysql database?
  2. hello every one... I have a database that need to be queried more than 2 lakh rows... but after quering 10,000 results or so,, the mysql is taking longer time to load.... Is there any way to upload those rows to dat database faster..... And i'm thing if it were taking so much time to load, then how much time will it take to query results from it.... Any help guys..... Thank you in advance....
  3. I am trying to code a query whereby the query checks for duplicate items in a table and if found sends an error back to jquery. However, what is happening, is that jquery keeps giving me a typeError and I cannot see why. In my posted code, the code that is commented out, /* if ($box == 'DEMO111') works fine but not my query. All mysql connections are working and I can connect to the db. I would be grateful if someone could check my code and show me where I have gone wrong. Thanks DB Config <?php function runSQL($rsql) { $hostname = "localhost"; $username = "root"; $password = ""; $dbname = "logistor_logistor"; $connect = mysql_connect($hostname,$username,$password) or die ("Error: could not connect to database"); $db = mysql_select_db($dbname); $result = mysql_query($rsql) or die (mysql_error()); return $result; mysql_close($connect); ?> <?php $array = split('[,]', $_POST['box_add']); $boxerrortext = 'No duplicate boxes'; ?> <?php if (isset($_POST['submit'])) { $error = array(); foreach ($array as $box) { $sql = "SELECT * FROM act WHERE item = '" . $box . "'"; $result = runSQL($sql) or die(mysql_error()); $num_rows = mysql_num_rows($result); if ($num_rows) { //trigger_error('It exists.', E_USER_WARNING); $error[] = array('boxerror'=>$boxerrortext, 'box'=>$box); $result = json_encode($error); echo $result; return; } } /* if ($box == 'DEMO111') { //echo 'There was an error somewhere'; //$box = 'ERROR'; //$error = array('boxerror'=>$boxerrortext, 'box'=>$box); //$output = json_encode($error); //echo $output; //return; } */ else { $form = array(); foreach ($array as $box) { $form[] = array('dept'=>$dept, 'company'=>$company, 'address'=>$address, 'service'=>$service, 'box'=>$box, 'destroydate'=>$destroydate, 'authorised'=>$authorised, 'submit'=>$submit); $sql = "INSERT INTO `temp` (service, activity, department, company, address, user, destroydate, date, item, new) VALUES ('$service', '$activity', '$dept', '$company', '$address', '$requested', '$destdate', NOW(), '$box', 1)"; $result = runSQL($sql) or die(mysql_error()); } } } $result=json_encode($form); echo $result; ?>
  4. I'm just a beginner with PHP. I created a PHP login system. Now I want to echo the username to the logged in user on the index.php page. Here's the code I have so far. It would be great if someone could suggest a way of doing this. Thanks! login.php <?php session_start(); require_once 'classes/Membership.php'; $membership = new Membership(); // If the user clicks the "Log Out" link on the index page. if(isset($_GET['status']) && $_GET['status'] == 'loggedout') { $membership->log_User_Out(); } // Did the user enter a password/username and click submit? if($_POST && !empty($_POST['username']) && !empty($_POST['pwd'])) { $response = $membership->validate_User($_POST['username'], $_POST['pwd']); } ?> <!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>Login</title> <link rel="stylesheet" type="text/css" href="css/default.css" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js"></script> <script type="text/javascript" src="js/main.js"></script> </head> <body> <div id="login"> <form method="post" action=""> <h2>Login <small>enter your credentials</small></h2> <p> <label for="username">Username: </label> <input type="text" name="username" /> </p> <p> <label for="pwd">Password: </label> <input type="password" name="pwd" /> </p> <p> <input type="submit" id="submit" value="Login" name="submit" /> </p> </form> <?php if(isset($response)) echo "<h4 class='alert'>" . $response . "</h4>"; ?> </div><!--end login--> </body> </html> index.php (the page that the user is redirected to after logging in) <?php require_once 'classes/Membership.php'; $membership = New Membership(); $membership->confirm_Member(); ?> <!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" /> <link rel="stylesheet" href="css/default.css" /> <!--[if lt IE 7]> <script type="text/javascript" src="js/DD_belatedPNG_0.0.7a-min.js"></script> <![endif]--> <title>Untitled Document</title> </head> <body> <div id="container"> <p> You have logged in. </p> <a href="login.php?status=loggedout">Log Out</a> </div><!--end container--> </body> </html> membership.php <?php require 'Mysql.php'; class Membership { function validate_user($un, $pwd) { $mysql = New Mysql(); $ensure_credentials = $mysql->verify_Username_and_Pass($un, md5($pwd)); if($ensure_credentials) { $_SESSION['status'] = 'authorized'; header("location: index.php"); } else return "Please enter a correct username and password"; } function log_User_Out() { if(isset($_SESSION['status'])) { unset($_SESSION['status']); if(isset($_COOKIE[session_name()])) setcookie(session_name(), '', time() - 1000); session_destroy(); } } function confirm_Member() { session_start(); if($_SESSION['status'] !='authorized') header("location: login.php"); } } mysql.php <?php require_once 'includes/constants.php'; class Mysql { private $conn; function __construct() { $this->conn = new mysqli(DB_SERVER, DB_USER, DB_PASSWORD, DB_NAME) or die('There was a problem connecting to the database.'); } function verify_Username_and_Pass($un, $pwd) { $query = "SELECT * FROM users WHERE username = ? AND password = ? LIMIT 1"; if($stmt = $this->conn->prepare($query)) { $stmt->bind_param('ss', $un, $pwd); $stmt->execute(); if($stmt->fetch()) { $stmt->close(); return true; } } } } Thanks a lot!
  5. Hi guys, I've been following some discussions in Linux forums about migrating from MySQL to MariaDB. Linux community seems very enthusiastic about this migration and some distros already set MariaDB as their default SQL database, for example, OpenSUSE 13.1. But what do you, web developers, think about this? Overall, are web developers really planning to migrate from MySQL to MariaDB? Do you think MariaDB will be more used than MySQL in the near future?
  6. I have this query : $sql ="SELECT * FROM card c JOIN driver d ON c.referred_as=d.referred_as WHERE d.ID='$id'"; It needs to be updated to include the 3rd table which is a joined table containing the driver and card id's from their respective tables. Table 1 is called "card" . The fields that are important are: "state_id" - This table has 3 values (1,2,3) "associated_driver" - called "referred_as" on driver table // Not actually part of the table . Created by the 3rd table "referred_as" - called "associated_card" on driver table Table 2 is called "driver". The fields that are important are: "ID" - The auto incremented value of the table "associated_card" - Has a value , normally some number e.g 123555 // Not actually part of the table . Created by the 3rd table "referred_as" - The name of the driver () called "associated_driver" on card table Forgot to add this table : Table 3 is called "card_driver". The fields that are important are: "driver_id" - The id from the driver table that links to the card "card_id" - The id from the card table that links to the driver What i want to happen : When a user enters their id from the driver table, it will compare a field that both tables have i.e the 'associated card' field (called referred_as on the card table). The associated card is from the joined table which i dont know how to get into the query. Any help is welcomed. If you need me to explain it more , i will.
  7. Hi all, I really need some help here please. I am going to include my code that I have. Problem is the select box is not loading from the database. The connection is there, that I have established. But the select box is just not populating. I have now been trying for the last 3 days and just cannot get this to work. I really need some help here please! I am sorry if this is a topic that has been thrashed to death, but I am at my wits end and just cannot get this to work no matter how hard I Google!! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Teaching Int Limited - Home</title> <meta name="title" content="Teaching Int Limited"> <link rel="shortcut icon" href="home/images/favicon.ico"> <meta http-equiv="Window-target" content="_top"> <meta http-equiv="Content-Type" content="text/html; charset=us-ascii"> <meta http-equiv="Content-Language" content="en-gb"> <meta name="MSSmartTagsPreventParsing" content="TRUE"><!--Providing Quality English Teachers to Schools and Organisations--> <meta name="description" content="Providing Quality English Teachers to Schools and Organisations"> <meta name="Abstract" content="Providing Quality English Teachers to Schools and Organisations"> <meta name="keywords" content="TEFL,english,teacher"> <meta name="Robots" content="index, follow"> <meta name="Distribution" content="Global"> <meta name="Revisit-After" content="30 days"> <meta name="Rating" content="General"> <meta name="Reply-to" content="info@teaching-int.com"> <meta name="Owner" content="Teaching Int Limited"> <meta name="Author" content="Carter Langley"> <meta name="copyright" content="Teaching Int Limited - 2013"> <link href='http://fonts.googleapis.com/css?family=Great+Vibes' rel='stylesheet' type='text/css'> <link rel="stylesheet" type="text/css" href="form.css"> <link rel="stylesheet" type="text/css" href="header.css"> <link rel="stylesheet" type="text/css" href="site.css"> </head> <body> <?php include("header.php"); ?> <?php if(isset($_POST['add'])) { $dbhost = 'localhost'; $dbuser = 'root'; $dbpass = 'password'; $dbbase = 'database'; $conn = mysql_connect($dbhost, $dbuser, $dbpass, $dbbase); if(! $conn ) { die('Could not connect: ' . mysql_error()); } $campus_id = $_POST['campus_id']; $company_id = $_POST['company_id']; $campus_name = $_POST['campus_name']; $address_street = $_POST['address_street']; $address_city = $_POST['address_city']; $address_province = $_POST['address_province']; $address_postalcode = $_POST['address_postalcode']; $address_country = $_POST['address_country']; $main_tel = $_POST['main_tel']; $second_tel = $_POST['second_tel']; $main_email = $_POST['main_email']; $second_email = $_POST['second_email']; $sql = "INSERT INTO `teaching`.`campus` (`campus_id`, `company_id`,'campus_name','address_street','address_city','address_province','address_postalcode','address_country','main_tel','second_tel','main_email','second_email') VALUES ('NULL', '$company_id','$campus_name','$address_street','$address_city','$address_province','$address_postalcode','$address_country','$main_tel','$second_tel','$main_email','$second_email')"; $retval = mysql_query( $sql, $conn ); if(! $retval ) { die('Could not enter data: ' . mysql_error()); } echo "Entered data successfully. Redirecting in 2 seconds.\n"; mysql_close($conn); header('Refresh: 2; URL=edit.php'); } else { ?> <form method="post" action="<?php $_PHP_SELF ?>"> <table width="100%" align="left" border="0" cellspacing="1" cellpadding="2"> <tr> <td><label for="company_id">Company</label></td> <td> <select name="company_name"> <option value="">--- Select a Company ---</option> <?php $sql_select = "SELECT * FROM `company`"; $retval_selectcompany = mysql_query( $sql_select, $conn ); while($row = mysql_fetch_assoc($retval_selectcompany)) { echo '<option value='.$row["company_name"].'>'.$row["company_name"].'</option>'; } ?> </select> </td> </tr> <tr> <td><label for="campus_name">Campus Name</label></td> <td><input name="campus_name" type="text" id="campus_name"></td> </tr> <tr> <td><label for="address_street">Street Address</label></td> <td><input name="address_street" type="text" id="address_street"></td> </tr> <tr> <td><label for="address_city">City</label></td> <td><input name="address_city" type="text" id="address_city"></td> </tr> <tr> <td><label for="address_province">Province</label></td> <td><input name="address_province" type="text" id="address_province"></td> </tr> <tr> <td><label for="address_postalcode">Postal Code</label></td> <td><input name="address_postalcode" type="text" id="address_postalcode"></td> </tr> <tr> <td><label for="address_country">Country</label></td> <td><input name="address_country" type="text" id="address_country"></td> </tr> <tr> <td><label for="main_tel">Main Tel</label></td> <td><input name="main_tel" type="text" id="main_tel"></td> </tr> <tr> <td><label for="second_tel">Alt Tel</label></td> <td><input name="second_tel" type="text" id="second_tel"></td> </tr> <tr> <td><label for="main_email">Main Email</label></td> <td><input name="main_email" type="text" id="main_email"></td> </tr> <tr> <td><label for="second_email">Second Email</label></td> <td><input name="second_email" type="text" id="second_email"></td> </tr> <tr> <td></td> <td> <input name="add" type="submit" id="add" value="Add Campus"> </td> </tr> </table> </form> <?php } ?> </body> </html>
  8. Hello every one I'm developing a ad agency wbsite for my college and i want to know how to detect whether the publishers site is running in a traffic exchange site... i dont want any publishers to use our ads in any auto surf or traffic exchange site.... Which will ultimately increase add impression unnecessarily. Is there any way to detect that... If a user is found to be faulty then his account will be blocked... I hope dat i have explained correctly.... Thanks in advance...
  9. I have HTML form linked with MYSQL database via PHP. If I submit this form, values will save in MYSQL database but not load into form. I see there old values so I have to refresh page to see desired values. I would like to see new values at form submission. *** I solved it when i put header("Location: edit.php?page=zakladni_udaje.php") ( = same as form action) on THE END OF ISSET form submit, it worked fine but I cant print message about success or fail after submiting. <?php ob_start(); session_start(); ?> <form action="edit.php?page=zakladni_udaje.php" method="post"> <?php $con = mysql_connect("localhost", "mairichovci", "ak41801") or die("Nelze se připojit k MySQL: " . mysql_error()); mysql_select_db("mairichovci") or die("Nelze vybrat databázi: ". mysql_error()); if($_SESSION['id'] > 0){ $profil_pomocny = mysql_query("SELECT * from profil where id=".$_SESSION['id'], $con); $profil = MySQL_Fetch_Assoc($profil_pomocny); $or_pomocny = mysql_query("SELECT * from osobaky where id=".$_SESSION['id'], $con); $or = MySQL_Fetch_Assoc($or_pomocny); $zobraz_pomocny = mysql_query("SELECT * from zobraz where id=".$_SESSION['id'], $con); $zobraz = MySQL_Fetch_Assoc($zobraz_pomocny); $id = $_SESSION['id']; $fce = $_POST['fce']; $email = $_POST['email']; $tel = $_POST['tel']; $position = $_POST['position']; $home = $_POST['home']; $omne = $_POST['omne']; if( isset ($_POST['uloz'])): $sql = "UPDATE profil SET fce = '$fce', email = '$email', tel = $tel, position = '$position', home = '$home', omne = '$omne' WHERE id = '$id'"; if (!mysql_query($sql)): die('Chyba: ' . mysql_error()); else: $message = "Údaje byly uloženy"; endif; mysql_close(); endif; echo '<div id="message">'.$message.'</div>'; ?> <table style = "margin-top: -1px" align="center" class="tabulka"> <tr> <td width="40%">Funkce:</td> <td><input type="text" name="fce" placeholder = "(např. Běžec - 800m, 1500m a delší)" maxlength="35" size="48" value="<?php echo $profil['fce']; ?>" class="vstupy" style="width: 350px"></td> </tr> <tr> <td></td> <td><input type="submit" name="uloz" value="Ulož" class="tlacitko2" style="width: 350px; margin-left:4px"></td> </tr> </table> </form> <?php } else{header("Location: prihlas.php");} ob_end_flush(); ?> Can anybody help me? Thanks in advance
  10. I have three tables tables : Table 1 is called "card" . The fields that are important are: - "state_id" - This table has 3 values (1,2,3) - "associated_driver" - Has a text value e.g John Smith - "referred_as" - Has a value , normally some number e.g 123555 Table 2 is called "entrylog" . The fields that are important are: - "ID" - The auto incremented value of the table. - "driver_id" - The value that links it to the ID filed of the driver table. Table 3 is called "driver". The fields that are important are: - "ID" - The auto incremented value of the table - "associated_card" - Has a value , normally some number e.g 123555 - "referred_as" - The name of the driver I already have a field where the user can enter data (the entrylog ID), and a way to do the query . I just need to get the actual query correct. What I want the MySQL query to do: When a user enters an ID (from one of the entry's in the entrylog table) , the query compares the driver_id value to the value of ID on the driver table. When it finds a match , it then compares the value of the associated _card and referred_as (from the driver table ) to referred_as and associated_driver (from the card table). When those are verified as being the same , it then looks to the state_id field for that entry that has just been verified . It returns the value of state id . Its a bit confusing , I know. I have posted code for what I have now (the query is totally wrong , but it shows how the result is checked. ) Thanks in advance. $id = $_POST['id']; $sql ="SELECT * FROM card WHERE id = '$id'" ; mysql_select_db('damp'); $result = mysql_query( $sql, $conn ); $row = mysql_fetch_assoc($result); switch($row['state_id']) { case "1": echo "<strong><font color=\"green\">Authorisation Granted!</font></strong>"; break; case "2": echo "<strong><font color=\"red\">Your card has expired and authorisation is denied</font></strong>"; break; case "3": echo "<strong><font color=\"red\">Your card has been cancelled and authorisation is denied</font></strong>"; break; default: echo "<strong><font color=\"red\">The Card ID does not exist</font></strong>"; }
  11. Hi Pals. I have a select option named doctor that i need to depend on the another select option named field, just like in Months and days where February shows 29 days in the days select option when clicked. The only difference here is that my data source is from mysql database instead of just html.
  12. Hi all, So first off i would like to say this is my first shopping cart in the making. Ive been playing around with a few ways to build one and choose a rather simple way to make it all work.. How ever Im getting the dreaded undefined var error in a few places of my code.. If anyone wouldnt mind reading through my code.. And just btw this specific render is for a mini cart display and not the main cart before the check out. <?php //RENDERING CART % Display Settings $cartOutput = ""; $cartTotal = ""; $pp_checkout_btn = ''; $product_id_array = ''; if (!isset($_SESSION["cart_array"]) || count($_SESSION["cart_array"]) < 1) { $cartOutput = "<h2 align='center'>Your shopping cart is empty</h2>"; } else { // Start PayPal Checkout Button $pp_checkout_btn .= '<form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_cart"> <input type="hidden" name="upload" value="1"> <input type="hidden" name="business" value="you@youremail.com">'; // Start the For Each loop $i = 0; foreach ($_SESSION["cart_array"] as $each_item) { $item_id = $each_item['item_id']; $sql = mysql_query("SELECT * FROM products WHERE id='$item_id' LIMIT 1"); while ($row = mysql_fetch_array($sql)) { $product_name = $row["product_name"]; } // Dynamic Checkout Btn Assembly $x = $i + 1; $pp_checkout_btn .= '<input type="hidden" name="item_name_' . $x . '" value="' . $product_name . '"> //ERROR HERE FOR PRODUCT NAME <input type="hidden" name="amount_' . $x . '" value="' . $price . '"> //ERROR HERE WITH PRICE VAR <input type="hidden" name="quantity_' . $x . '" value="' . $each_item['quantity'] . '"> '; // Create the product array variable $product_id_array .= "$item_id-".$each_item['quantity'].","; // Dynamic table row assembly $cartOutput .= '<div style="float:left;width:89%"> <form action="view_cart.php" method="post"> <input name="quantity" type="text" value="' . $each_item['quantity'] . '" size="1" maxlength="2" /> <input name="adjustBtn' . $item_id . '" type="submit" value="change" /> <input name="item_to_adjust" type="hidden" value="' . $item_id . '" /> </form> X <span>' . $product_name . '</span> //ERROR HERE FOR PRODCT NAME VAR </div> <div style="float:right;width:10%;text-align:center;"> <form action="cart.php" method="post"><input name="deleteBtn' . $item_id . '" type="submit" value="X" /><input name="index_to_remove" type="hidden" value="' . $i . '" /></form> </div> '; $i++; } // Finish the Paypal Checkout Btn $pp_checkout_btn .= '<input type="hidden" name="custom" value="' . $product_id_array . '"> <input type="hidden" name="notify_url" value="https://www.yoursite.com/storescripts/my_ipn.php"> <input type="hidden" name="return" value="https://www.yoursite.com/checkout_complete.php"> <input type="hidden" name="rm" value="2"> <input type="hidden" name="cbt" value="Return to The Store"> <input type="hidden" name="cancel_return" value="https://www.yoursite.com/paypal_cancel.php"> <input type="hidden" name="lc" value="US"> <input type="hidden" name="currency_code" value="USD"> <input type="image" src="http://www.paypal.com/en_US/i/btn/x-click-but01.gif" name="submit" alt="Make payments with PayPal - its fast, free and secure!"> </form>'; } ?> Ive commented the lines that hold errors, i have checked the var list, just really doesnt make much sense to me. Any help would be appreciated.. Thanks in advance.
  13. Hello I'm new on this forum, I have a commercial project (a software with licence renovation every year), I want to every time I have a new client, register on a mysql database, so when the client pay (on paypal) a licence renovation after the payment redirect to a php login site, when the client get logged show a kind of validator where the client can type the renovation number to generate and show the unlock code at the same time automatically it is sent to the clients email, after that, if the user wants to log in again, show only the unlock code, until the client do a payment and show the validator again, and so on.. Is all this possible? I already have a hosting with php and mysql database, but I don't have any knowledge on php, also I have no idea how to make the validator on a website, but It's based on math operations so I think it wont be a problem
  14. Hi, I have some data to upload through php and the data could be in zipped or RAR format and file size could be more than 400MB. So i need some good code to work on this with minimum data loose and error. Could it be possible to upload such a large amount of data through php, if yes then i request to you please suggest some good stuff to use. Thanks
  15. Dear Candidate Greetings from Netzmarkt!! We are a web development company located in Bangalore & we are looking for PHP Developer. Please find the JD below. Education: Any Graduation Joining Location: Bangalore Experience: 2.5 - 6 yrs JOB SUMMARY: ------------------------- Develop applications. Suitable candidates are required to create and implement project plans independently. DESIRED PROFILE: ---------------------------- Should have 2.5Yrs of experience in PHP Atleast 2.5Yrs of experience in HTML Profound experience in programming SQL databases, knowledge of MySQL is of advantage Familiar with working on a Linux Operating System Should be capable of architecting PHP based applications Using PHP Frameworks in the project will be an advantage Expert in Internet/Intranet web applications and projects Should be able to develop projects independently You may be leading a small team of PHP developers Excellent oral and written communication. If you are interested, please forward your updated profile to career[at]netzmarkt[dot]in Thanks & Regards, Smitaa Human Resources
  16. I would appreciate any form of help to this problem: I have two tables named doctors and fields with a one to many relationship with the field being the one part and doctors the many part. My form is supposed to insert into the doctors' table and as well select has a select option the chooses from already existing fields in the fields table. The name of my foreign key in the doctors' table is "field_id". How can i this insert in the two tables?
  17. Hi, I have a form, while submitting this i need to store the values into two different tables in a database,Some values will store in a table and others will store in a another table. How can i write it's query ? For Example, $sql="INSERT INTO table1 (field1, field2, field3,field4) VALUES ('$_POST[column1]','$_POST[column2]','$_POST[column3]','$_POST[column4]')"; $sql2="INSERT INTO table2 (field5, field6, field7,field8) VALUES ('$_POST[column5]','$_POST[column6]','$_POST[column7]','$_POST[column8]')"; For me like this, Only one $sql values are only inserting, $sql2 values are not inserting. Thanks in Advance
  18. Hi, I am using a code to fetch values from the database using php code in Html format. but i am facing a problem while fetching table having more than 1000 rows that giving the result "Null", but for lesser rows table this code working fine. Here is the code... <?php include("repo_db.php"); $query=mysql_query("Select * from tbl_coupons") or die(mysql_error()); if(!$query) { mysql_close(); echo json_encode("There was an error running the query: " . mysql_error()); } else if(!mysql_num_rows($query)) { mysql_close(); echo json_encode("No result return!"); } else { $header = false; $output_string = "Production Details By Customer Name"; $output_string .= "\n"; while($row = mysql_fetch_assoc($query)) { if(!$header) { $output_string .= "\n"; foreach($row as $header => $value) { $output_string .= "{$header}\n"; } $output_string .= "\n"; } $output_string .= "\n"; foreach($row as $value) { $output_string .= "{$value}\n"; } $output_string .= "\n"; } $output_string .= "\n"; } mysql_close(); // This echo for jquery echo json_encode($output_string); ?> Can anyone suggest the problem solution. Thanks
  19. Hey , i have a problem in encrypting a password in mysql in the register form if anyone registered make their password encrypt in mysql database but when i want to login i must used the encrypting password ,, is there's a way to use that password i entered in register form for e.g ( 1234 ) not the encrypted password
  20. Hey im trying to make a small little game for my self at the moment, to test my self a little, the game i creating is based a little on the game http://ogame.org, im trying to find out how i can make the ressources auto increase on each member created on my site as the site ogame has, i dont need the javescript so you can see it auto increase, but just need to refresh it and then i can see that it has gone up, in my game im using Gold, Silver and Copper as ressources atm, and im not sure how to make the number in my database auto increase while the user have logged out, i was thinking about using some kind of function that would increse copper with 1 for each sec there goes with a timestamp or something like that, any of you guys knows how this could be possible? Regards Dan Larsen
  21. We Have online shopping portal Named Oshopindia.com recently we created mobile website for oshopindia on products page we want to add pagination for products We impliment many code of pagination but it's not working properly in mobile website Can anybody Suggest me any simple pagination code for Mobile website
  22. So here I was trying mkdir function with 0777 permissions. Everything worked fine. However when it came to delete the images in the directory, it won't let me. I have a 404 error page set up and it takes me to that page after i click delete. I had a backup of the this project before i added mkdir. So I went back to it and it's still taking me to the 404 error when deleting an image. While on 404 page; in the address bar, it's still shows the id of the file to be deleted. For eg. http://localhost/project/delete.php?id=199 Can someone explain to me what is going on?
  23. <?php <?php if(isset($_REQUEST['testid'])) { /************************** Step 3 - Case 2 *************************/ // Displays the Existing Test Results in detail, If any. $result=executeQuery("select t.testname,DATE_FORMAT(t.testfrom,'%d %M %Y') as fromdate,DATE_FORMAT(t.testto,'%d %M %Y %H:%i:%S') as todate,sub.subname,IFNULL((select sum(marks) from question where testid=".$_REQUEST['testid']."),0) as maxmarks from test as t, subject as sub where sub.subid=t.subid and t.testid=".$_REQUEST['testid'].";") ; if(mysql_num_rows($result)!=0) { $r=mysql_fetch_array($result); ?> <table class="table table-striped"> <tr> <td colspan="2"><h3 style="color:#0000cc;text-align:center;">Test Summary</h3></td> </tr> <tr> <td colspan="2" ><hr style="color:#ff0000;border-width:4px;"/></td> </tr> <tr> <td>Test Name</td> <td><?php echo htmlspecialchars_decode($r['testname'],ENT_QUOTES); ?></td> </tr> <tr> <td>Subject Name</td> <td><?php echo htmlspecialchars_decode($r['subname'],ENT_QUOTES); ?></td> </tr> <tr> <td>Validity</td> <td><?php echo $r['fromdate']." To ".$r['todate']; ?></td> </tr> <tr> <td>Max. Points</td> <td><?php echo $r['maxmarks']; ?></td> </tr> <tr><td colspan="2"><hr style="color:#ff0000;border-width:2px;"/></td></tr> <tr> <td colspan="2"><h3 style="color:#0000cc;text-align:center;">Attempted Students</h3></td> </tr> <tr> <td colspan="2" ><hr style="color:#ff0000;border-width:4px;"/></td> </tr> </table> <form name="getcvs" action="try.php" method="POST"> <?php $result1=executeQuery("select s.stdname,s.stdlastname,s.emailid,IFNULL((select sum(q.marks) from studentquestion as sq,question as q where q.qnid=sq.qnid and sq.testid=".$_REQUEST['testid']." and sq.stdid=st.stdid and sq.stdanswer=q.correctanswer),0) as om from studenttest as st, student as s where s.stdid=st.stdid and st.testid=".$_REQUEST['testid'].";" ); if(mysql_num_rows($result1)==0) { ?> <center><div class="alert alert-success">No student attempted this test.</div> </center> <?php } else { ?> <table class="table table-striped"> <tr> <th>Student Name</th> <th>Email-ID</th> <th>Obtained Points</th> <th>Result(%)</th> </tr> <?php while($r1=mysql_fetch_array($result1)) { ?> <tr> <td><input type="text" value="<?php echo htmlspecialchars_decode($r1['stdname'],ENT_QUOTES);?> <?php echo htmlspecialchars_decode($r1['stdlastname'],ENT_QUOTES); ?>" name="std"</td> <td><input type="text" value="<?php echo htmlspecialchars_decode($r1['emailid'],ENT_QUOTES); ?>" name="em"/></td> <td><input type="text" value="<?php echo $r1['om']; ?>" name="om"/></td> <td><input type="text" value="<?php echo ($r1['om']/$r['maxmarks']*100)." %"; ?>" name="mm"/></td> </tr> </form> <?php } } } else { ?> <center> <div class="alert alert-success">Something went wrong. Please logout and Try again.</div></center> <?php } ?> </table> <input type="submit" name="submit" value="Download Excell File" class="btn btn-success" /> </form> <?php } else { /************************** Step 3 - Case 2 *************************/ // Defualt Mode: Displays the Existing Test Results, If any. $result=executeQuery("select t.testid,t.testname,DATE_FORMAT(t.testfrom,'%d %M %Y') as fromdate,DATE_FORMAT(t.testto,'%d %M %Y %H:%i:%S') as todate,sub.subname,(select count(stdid) from studenttest where testid=t.testid) as attemptedstudents from test as t, subject as sub where sub.subid=t.subid and t.tcid=".$_SESSION['tcid'].";"); if(mysql_num_rows($result)==0) { ?> <center> <div class="alert alert-success">There is no examination yet.</div> </center> <?php } else { $i=0; ?> <table class="table table-striped"> <tr> <th>Test Name</th> <th>Validity</th> <th>Subject Name</th> <th>Attempted Students</th> <th>Details</th> </tr> <?php while($r=mysql_fetch_array($result)) { $i=$i+1; if($i%2==0) { echo "<tr class=\"alt\">"; } else { echo "<tr>";} echo "<td>".htmlspecialchars_decode($r['testname'],ENT_QUOTES)."</td><td>".$r['fromdate']." To ".$r['todate']." PM </td>" ."<td>".htmlspecialchars_decode($r['subname'],ENT_QUOTES)."</td><td>".$r['attemptedstudents']."</td>" ."<td class=\"tddata\"><a title=\"Details\" href=\"rsltmng.php?testid=".$r['testid']."\"><img src=\"../images/detail.png\" height=\"30\" width=\"40\" alt=\"Details\" /></a></td></tr>"; } ?> </table> <?php } } closedb(); } ?> I NEED TO EXPORT STUDENTNAME,LASTNAME EMAILID , OBTAINED POINTS ['om'] and maxmarks ['maxmarks'] Can you please give me a script to export those ? PLEASE
  24. Hello, My scenario is I need to have a unique value in a column based on value from another column. for ex : I have item_ID and product column For every item_ID there should only be unique values in the product column. item_ID Product 1 1 1 2 1 4 2 1 but if I insert 1 in item_ID and 1 in product now, it should throw an error. I have no idea how to implement this. Any help appreciated.
  25. Hi, I have this form which debits a user when they sell an item. This is based on a credit system. The script should ideally check the user has enough credits before posting the item, if not then it should redirect the user to purchase more credits. But instead it takes the user into a negative amount of credits and still writes the transaction and sale data to the mysql db. However when I run the script whilst the user has a negative amount, it does come up with the message saying the user does not have enough credits and redirects the user to purchase more credits. Ideally, I need to make credits stop at 0 and not allow the script to work if this would leave the user with a negative balance. Here is the form. Also it can be tested at www.e-quatics.com username aquaman password ozzy2004 <?php include 'core/init.php'; protect_page(); include 'includes/overall/header.php'; if (empty($_POST) === false) { $required_fields = array('username', 'email', 'category', 'listing_title', 'brand', 'model', 'colour', 'quantity', 'price', 'comments', 'postage_type', 'postage_cost'); foreach($_POST as $key=>$value) { if (empty($value) && in_array($key, $required_fields) === true) { $errors[] = 'Fields marked with an asterisk are required'; break 1; } } if (empty($errors) === true) { if(user_exists($_POST['username']) === false) { $errors[] = 'Sorry, the username \'' . $_POST['username'] . '\' does not exist. Have you registered?'; } if (filter_var($_POST['email'], FILTER_VALIDATE_EMAIL) === false) { $errors[] = 'A valid email address is required'; } if(empty($category) === false) { $errors[] = 'Please select a category'; } if(empty($listing_title) === false) { $errors[] = 'Please enter a title for your listing'; } if(empty($brand) === false) { $errors[] = 'Please enter a brand'; } if(empty($model) === false) { $errors[] = 'Please enter a model'; } if(empty($colour) === false) { $errors[] = 'Please enter a colour'; } if(empty($quantity) === false) { $errors[] = 'Please enter a quantity'; } if(empty($price) === false) { $errors[] = 'Please enter a price'; } if(empty($comments) === false) { $errors[] = 'Please enter some information about your item'; } if(empty($postage_type) === false) { $errors[] = 'Please enter a postage options'; } if(empty($postage_cost) === false) { $errors[] = 'Please enter the postage cost for this item.'; } } $query = "SELECT SUM(amount) FROM transactions WHERE user_id = {$_SESSION['user_id']}"; if ($result = mysql_query($query)) { $row = mysql_fetch_row($result); if ($row[0] <= 0) { echo "You either have no remaining credits or not enough to complete this transaction. You will be redirected to purchase more."; header( "Refresh:5; url=purchase.php", true, 303); exit(); } } } if (isset($_GET['success']) && empty($_GET['success'])) { echo '<h2>Thank you for submitting your listing. Your account has been debited.</h2>'; } else { if (empty($_POST) === false && empty($errors) === true) { $sale_data = array( 'user_id' => $user_data['user_id'], 'username' => $_POST['username'], 'email' => $_POST['email'], 'category' => $_POST['category'], 'listing_title' => $_POST['listing_title'], 'brand' => $_POST['brand'], 'model' => $_POST['model'], 'colour' => $_POST['colour'], 'quantity' => $_POST['quantity'], 'price' => $_POST['price'], 'comments' => $_POST['comments'], 'postage_type' => $_POST['postage_type'], 'postage_cost' => $_POST['postage_cost'], 'bold' => $_POST['bold'], 'rotate' => $_POST['rotate'] ); $bold = $_POST['bold']; $rotate = $_POST['rotate']; $total = $bold + $rotate + 1; $amount = -$total; $memo = "Debit for Item"; registerTransaction($user_id, $amount, $memo); register_saleItem($sale_data); header('Location: other_items.php?success'); exit(); } else if (empty($errors) === false) { echo output_errors($errors); } ?> <script type="text/javascript" src="jquery.js"></script> <form action="" id="sellForm" method="POST"> <input type="hidden" name="username" value="<?php echo $user_data['username']; ?>"></li> <input type="hidden" name="email" value="<?php echo $user_data['email']; ?>"></li> <h2>Sell your item</h2> <p><strong>A basic listing will cost 1 credit - extras will be added to the total cost of your listing</strong></p> <ul> <li>Category*:</br> <select name="category"> <option value="none">--choose--</option> <option value="air_pumps">Air Pumps</option> <option value="air_stones">Air Stones</option> <option value="aquariums">Aquariums</option> <option value="cleaning">Cleaning & Maintenance</option> <option value="equipment">CO2 Equipment</option> <option value="coral">Coral & Live Rock</option> <option value="decorations">Decorations</option> <option value="feeders">Feeders</option> <option value="filter_media">Filter Media & Accessories</option> <option value="food">Food</option> <option value="gravel">Gravel & Substrate</option> <option value="health_care">Health Care</option> <option value="heaters">Heaters & Chillers </option> <option value="lighting">Lighting & Hoods</option> <option value="meters">Meters & Controllers</option> <option value="deionization">Reverse Osmosis & Deionization </option> <option value="tubing">Tubing & Valves</option> <option value="uv">UV Steriliser Water Pumps</option> <option value="water_tests">Water Tests & Treatment</option> <option value="other">Other Fish & Aquarium</option> </select> </li> <li>Listing Title*:</br> <input type="text" name="listing_title"> <li><strong>Would you like your listing displayed in Bold?: <input type="checkbox" name="bold" value="1"/> 1 Credit</strong> </li> <li>Brand*:</br> <select name="brand"> <option>Choose...</option> <option value="AI (Aqua Illumination)">AI (Aqua Illumination)</option> <option value="Algarde">Algarde</option> <option value="API">API</option> <option value="AquaEl">AquaEl</option> <option value="AquaGro">AquaGro</option> <option value="Aquamedic">Aquamedic</option> <option value="Aquarian">Aquarian</option> <option value="Aquarium Systems">Aquarium Systems</option> <option value="Aquatlantis">Aquatlantis</option> <option value="Arcadia">Arcadia</option> <option value="Azoo">Azoo</option> <option value="BiOrb/Reef One">BiOrb/Reef One</option> <option value="Blagdon">Blagdon</option> <option value="Boyu">Boyu</option> <option value="Classica">Classica</option> <option value="Cloverleaf">Cloverleaf</option> <option value="Deltec/D-D">Deltec/D-D</option> <option value="Dennerle">Dennerle</option> <option value="Eheim">Eheim</option> <option value="ESHa">ESHa</option> <option value="Hagen/Fluval">Hagen/Fluval</option> <option value="Hikari">Hikari</option> <option value="Hobby">Hobby</option> <option value="Hugo Kamishi">Hugo Kamishi</option> <option value="Interpet">Interpet </option> <option value="JMC">JMC</option> <option value="Juwel">Juwel</option> <option value="King British">King British</option> <option value="New Era">New Era</option> <option value="Nishikoi">Nishikoi</option> <option value="NT Labs">NT Labs</option> <option value="Oase">Oase</option> <option value="Ocean Nutrition">Ocean Nutrition</option> <option value="Penn Plax">Penn Plax</option> <option value="Pontec">Pontec</option> <option value="Red Sea">Red Sea</option> <option value="Rena">Rena</option> <option value="Salifert">Salifert</option> <option value="Seachem">Seachem</option> <option value="Seneye">Seneye</option> <option value="SuperFish">SuperFish</option> <option value="Tanktests">Tanktests</option> <option value="Tetra">Tetra</option> <option value="TMC">TMC</option> <option value="Tunze">Tunze</option> <option value="Two Little Fishies">Two Little Fishies</option> <option value="Waterlife">Waterlife</option> <option value="Wave Point">Wave Point</option> <option value="other">Other</option> </select> </li> <li>Model*:</br> <input type="text" name="model"> </li> <li>Colour*:</br> <select name="colour"> <option value="">--choose one--</option> <option value="White">White</option> <option value="Grey">Grey</option> <option value="Black">Black</option> <option value="Blue">Blue</option> <option value="Green">Green</option> <option value="Orange">Orange</option> <option value="Red">Red</option> <option value="Multicoloured">Multicoloured</option> <option value="Other">Other</option> </select> </li> <li>Quantity*:</br> <select name="quantity"> <option value="">--choose one--</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option> <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> <option value="21">21</option> <option value="22">22</option> <option value="23">23</option> <option value="24">24</option> <option value="25">25</option> </select><strong> 1 Credit entitles you to sell up to 25 of the same item. </strong> </li> <li>Price*:<br> <input type="text" name="price"> In UK Pound Sterling </li> <li>Description*:</br> <textarea name="comments"></textarea> </li> <li>Postage Type*:</br> <select name="postage_type"> <option>Choose...</option> <option>Choose...</option> <option disabled>Economy services</option> <option value="UK_CollectPlusTracked">Collect+ Economy Tracked (3 to 5 working days)</option> <option value="UK_HermesTracked">Hermes Tracked (3 to 5 working days)</option> <option value="UK_RoyalMailSecondClassStandard">Royal Mail 2nd Class (2 to 3 working days)</option> <option value="UK_RoyalMailSecondClassRecorded">Royal Mail 2nd Class Signed For (2 to 3 working days)</option> <option value="UK_RoyalMailTracked">Royal Mail Tracked 48 (2 to 3 working days)</option> <option value="UK_RoyalMail48">Royal Mail 48 (2 to 3 working days)</option> <option value="UK_OtherCourier3Days">Other Courier 3 days (3 working days)</option> <option value="UK_OtherCourier5Days">Other Courier 5 days (5 working days)</option> <option value="UK_OtherCourier">Other Courier (3 to 5 working days)</option> <option value="UK_SellersStandardRate">Other Courier 3-5 days (3 to 5 working days)</option> <option disabled>Standard services</option> <option value="UK_RoyalMailFirstClassStandard">Royal Mail 1st Class (1 working day)</option> <option value="UK_RoyalMailFirstClassRecorded">Royal Mail 1st Class Signed For (1 working day)</option> <option value="UK_RoyalMailNextDay">Royal Mail Tracked 24 (1 working day)</option> <option value="UK_RoyalMail24">Royal Mail 24 (1 working day)</option> <option value="UK_CollectPlusStandard">Collect+ Standard (2 working days)</option> <option value="UK_Parcelforce48">Parcelforce 48 (1 to 2 working days)</option> <option value="UK_OtherCourier48">Other 48 Hour Courier (1 to 2 working days)</option> <option disabled>Express services</option> <option value="UK_RoyalMailSpecialDeliveryNextDay">Royal Mail Special Delivery (TM) 1:00 pm (1 working day)</option> <option value="UK_RoyalMailSpecialDelivery9am">Royal Mail Special Delivery (TM) 9:00 am (1 working day)</option> <option value="UK_Parcelforce24">Parcelforce 24 (1 working day)</option> <option value="UK_OtherCourier24">Other 24 Hour Courier (1 working day)</option> <option disabled>Services from outside UK</option> <option value="UK_EconomyShippingFromOutside">Economy Delivery from outside UK (10 to 22 working days)</option> <option value="StandardDeliveryfromOutsideUKwithRoyalMail">Standard Delivery from outside UK with Royal Mail (7 to 13 working days)</option> <option value="UK_StandardShippingFromOutside">Standard Delivery from outside UK (4 to 10 working days)</option> <option value="UK_ExpeditedShippingFromOutside">Express Delivery from outside UK (1 to 3 working days)</option> <option value="UK_FedExIntlEconomy">FedEx International Economy (3 to 4 working days)</option> <option value="UK_TntIntlExp">TNT International Express (2 to 3 working days)</option> <option value="UK_TrackedDeliveryFromAbroad">Tracked delivery from outside UK (2 to 5 working days)</option> <option disabled>Collection</option> <option value="UK_CollectInPerson">Collection in Person </option> </select> </li> <li>Postage Cost*:</br> <input type="text" name="postage_cost"> </li> </ul> <ul> <li>Upload Photo:</br> <input id="file" type="file" name="uploadPhoto"> </li> <li><input type="checkbox" name="rotate" value="10"/><strong>For 10 credits, you can have your listing displayed on our homepage on a rotation basis. </strong> </li> <li> <input type="submit" value="List Item"></li> </ul> </form> <?php } ?> <?php include 'includes/overall/footer.php'; ?> Many Thanks Paul
×
×
  • 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.