Jump to content

Search the Community

Showing results for tags 'php'.

  • 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. Hi, i have a registration form (screenshot attached). I create two table to store them, one customer_master, send item_details. but i want to know how to get values of these (item) textboxes to insert into the database. Here is the code by which these fields are generating. Hi, i have a registration form (screenshot attached). I create two table to store them, one customer_master, send item_details. but i want to know how to get values of these (item) textboxes to insert into the database. Here is the code by which these fields are generating. <?php require_once("config.php"); $query_for_result=mysql_query("SELECT * FROM mytable ORDER BY id ASC"); $num=mysql_numrows($query_for_result); mysql_close(); ?> <table> <tr> <td >Sl.No..</td> <td >Item</td> <td >Paper</td> <td >Finish</td> <td>Price</td> <td >Vat</td> <td >Total Amount</td> </tr> <?php $i=0; while ($i < $num) { $f1=mysql_result($query_for_result,$i,"id"); $f2=mysql_result($query_for_result,$i,"album_name"); $f3=mysql_result($query_for_result,$i,"paper_used"); $f4=mysql_result($query_for_result,$i,"finishing"); $f5=mysql_result($query_for_result,$i,"price"); $f6=mysql_result($query_for_result,$i,"vat"); $f7=mysql_result($query_for_result,$i,"total_amt"); $id=$i+1; ?> <tr> <td><input id="slno" name="security_code" type="text" value="<?php echo $f1; ?>" style="width:20px;"/></td> <td ><input id="security_code" name="security_code" value="<?php echo $f2; ?>" type="text" style="width:150px;"/></td> <td ><input id="security_code" name="security_code" type="text" value="<?php echo $f3; ?>" style="width:85px;"/></td> <td ><input id="security_code" name="security_code" value="<?php echo $f4; ?>" type="text" style="width:90px;"/></td> <td ><input id="security_code" value="<?php echo $f5; ?>" name="security_code" type="text" style="width:25px;"/></td> <td ><input id="security_code" value="<?php echo $f6; ?>" name="security_code" type="text" style="width:35px;"/></td> <td ><input id="security_code" name="security_code" value="<?php echo $f7; ?>" type="text" style="width:50px;"/></td> </tr> <?php $i++; } ?> <tr> <td ><input id="security_code" name="security_code" type="text" value="26" style="width:20px;"/></td> <td ><input id="security_code" name="security_code" value="" type="text" style="width:150px;"/></td> <td ><input id="security_code" name="security_code" type="text" value="" style="width:85px;"/></td> <td ><input id="security_code" name="security_code" value="" type="text" style="width:90px;"/></td> <td ><input id="security_code" value="" name="security_code" type="text" style="width:25px;"/></td> <td ><input id="security_code" value="" name="security_code" type="text" style="width:35px;"/></td> <td ><input id="security_code" name="security_code" value="" type="text" style="width:50px;"/></td> </tr> <tr> <td ><input id="security_code" name="security_code" value="27" type="text" style="width:20px;"/></td> <td ><input id="security_code" name="security_code" value="" type="text" style="width:150px;"/></td> <td ><input id="security_code" name="security_code" type="text" value="" style="width:85px;"/></td> <td ><input id="security_code" name="security_code" value="" type="text" style="width:90px;"/></td> <td ><input id="security_code" value="" name="security_code" type="text" style="width:25px;"/></td> <td ><input id="security_code" value="" name="security_code" type="text" style="width:35px;"/></td> <td><input id="security_code" name="security_code" value="" type="text" style="width:50px;"/></td> </tr> <tr> <td ><input id="security_code" name="security_code" value="28" type="text" style="width:20px;"/></td> <td ><input id="security_code" name="security_code" value="" type="text" style="width:150px;"/></td> <td><input id="security_code" name="security_code" type="text" value="" style="width:85px;"/></td> <td ><input id="security_code" name="security_code" value="" type="text" style="width:90px;"/></td> <td ><input id="security_code" value="" name="security_code" type="text" style="width:25px;"/></td> <td><input id="security_code" value="" name="security_code" type="text" style="width:35px;"/></td> <td ><input id="security_code" name="security_code" value="" type="text" style="width:50px;"/></td> </tr> <tr> <td ><input id="security_code" name="security_code" value="29" type="text" style="width:20px;"/></td> <td><input id="security_code" name="security_code" value="" type="text" style="width:150px;"/></td> <td><input id="security_code" name="security_code" type="text" value="" style="width:85px;"/></td> <td ><input id="security_code" name="security_code" value="" type="text" style="width:90px;"/></td> <td ><input id="security_code" value="" name="security_code" type="text" style="width:25px;"/></td> <td ><input id="security_code" value="" name="security_code" type="text" style="width:35px;"/></td> <td><input id="security_code" name="security_code" value="" type="text" style="width:50px;"/></td> </tr> </table> I want to store data of all 29 text boxes. but don't know how to get values of these ? Thanks I want to store data of all 29 text boxes. but don't know how to get values of these ? Thanks
  2. Hi friends, i am new in php, user fill the text box to get the value and post it to the next page using ajax. this is my requirement. i call the textbox in while loop ,so i used the text box name is ship_quantity[] In jquery i get the value like that $('input[name="ship_quantity[]"]').each(function(){ var sq=$(this).val(); alert(sq); now i get the value of 1,2 as user inputs. my questions is how to extract this values and send to ajax post.
  3. hi, i have the next files to store an array[] into a mysql database. Now i would like to create a file to see the stored data, as an info file....like a table with the results or something. in phpmyadmin database i see the stored data as: a:2:{i:0;s:10:"sentra b15";i:1;s:10:"sentra b13";} thanks for your time index.php <html> <body> <form action="insert3.php" method="post"> Firstname: <input type="text" name="firstname[]"> <br> Firstname 2: <input type="text" name="firstname[]"> <br> Firstname 3: <input type="text" name="firstname[]"> <br> Firstname 4: <input type="text" name="firstname[]"> <br> <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(); } $data= $_POST['firstname']; $values= serialize($data); $sql="INSERT INTO input_field (firstname) VALUES ('$values')"; if (!mysqli_query($con,$sql)) { die('Error: ' . mysqli_error($con)); } echo "1 record added"; mysqli_close($con); ?>
  4. Hello. How can I integrate a "gallery maker" with TinyMCE editor, with images from external source (I don't want to upload images to my website server, because I have a limited storage space).
  5. Hi guys, This could be very simple but I am not sure what to search for and how it works. I have a Youtube Search function that brings a lot of videos with different values. For example [videoid] could be equal = CGyAaR2aWcA. [videoname] could be equal "the walking dead" and so on... Example html result: <li> 2 States - Official Trailer - Arjun Kapoor, Alia Bhatt (CGyAaR2aWcA<a href=http://www.youtube.com/watch?v=CGyAaR2aWcA?version=3&enablejsapi=1 target=_blank> Watch This Video</a> <img src=http://img.youtube.com/vi/CGyAaR2aWcA/0.jpg />) </li> <li> WHAT IS WRONG WITH YOU?! - The Walking Dead - Season 2 - Episode 2 - Part 2 (dsXhuOwPTTc<a href=http://www.youtube.com/watch?v=dsXhuOwPTTc?version=3&enablejsapi=1 target=_blank> Watch This Video</a> <img src=http://img.youtube.com/vi/dsXhuOwPTTc/0.jpg /><input type='submit' value='Add Song' name='create' />) </li> I want to be able to select one of the lists and insert the data into MYSQL DB. I already have a form with inputs that I have tested and works. What is the method of doing that kind of selections? Rad
  6. 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?
  7. 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....
  8. Hello PHP freaks Im trying to display table contents as Uploads or widrawals but would i have to create the functions inside the Widrawals and Uploads in order for it to be displayed in Overview table ? My code for overview table controller so far : By the way I'm using code igniter public function index() { $this->data['site']['currentNav'] = "account"; $query = $this->db->query("SELECT C.card_number AS `card_number` FROM `cards` C WHERE C.accountID = '". $this->account_id ."' AND C.status = '1'"); $this->data['cards'] = $query->result(); $query = $this->db->query("SELECT B.account_number AS `account_number`, B.sortcode AS `sortcode` FROM `banks` B WHERE B.accountID = '". $this->account_id ."' AND B.status = '1'"); $this->data['banks'] = $query->result(); $query = $this->db->query("SELECT T.transaction AS `transactionID`, T.timestamp AS `date`, IF(T.to = '". $this->account_id ."', 'Received', 'Sent') AS `type`, CONCAT(A.firstname, ' ', A.lastname) AS `name`, T.amount AS `amount` FROM `transactions` T JOIN `accounts` A ON (A.id = T.from) WHERE (T.to = '". $this->account_id ."' || T.from = '". $this->account_id ."') ORDER BY T.id DESC LIMIT 10"); $this->data['transactions'] = $query->result(); $this->load->view('_template/header', $this->data); $this->load->view('account/index', $this->data); $this->load->view('_template/footer', $this->data); }
  9. Hi I am new to PHP I am creating a web application which shows status of some sensors and controls some switches based on it. I do not have real sensors with me. How can I make another application which will simulate the sensors also receives the control commands from my applications and displays the command(in the test application) Can I make the test application also in PHP? Can I run my app and test app in two different browsers in same computer and test it? How can I manage the connection between them? Regards Ashok
  10. The correct choice, which somehow combines the chosen $term with the $term_presidents array map, is displayed on the right side. How do i go about doing this?
  11. Hi guys, I was wondering if i could have some help on a piece of functionality I am trying to implement onto a website I am currently developing. The Scenario is as follows : I have a table residing on a MySql data base called Bookings. The Bookings table consists of a composite primary key based upon the following 2 fields: BookingDate & Booking Slot. On my website, I have built a bookings page which will consist of a a simple HTML Form, which has a Date Field and a Radio-Button group which has 3 different time slots (eg: 9am, 2pm and 4pm). Firstly, the User will select a Date they would wish to place a booking on and then click a submit button called "Check Availablity". Once this button is clicked, Ideally, I would like a script to check an see what free slots are available for that Date and then disable the radio buttons related the slots which are already booked. Here is a simple scenario to help explain the functionality i am trying to implement : The User comes to the Bookings page, and selects the Date 14/03/2011. Then clicks the "Check Availablity" button. In this scenario, the 9am slot is already booked for this date (eg: this booking already exists on the MySql database table), so the 9am radio button on the page is then disabled, not allowing the user to try an attempt to book this timeslot on this date. Below is the a simplified version of the php script which I wrote to implement the this functionality. <?php function checkSlot() { // Get data $test_date = $_GET["bookingDate"]; // Database connection $conn = mysqli_connect("localhost","root","","wordpress"); if(!$conn) { die('Problem in database connection: ' . mysql_error()); } // Attempt to find Duplicate Primary Keys $query = "SELECT Count(*) AS 'total' FROM Bookings WHERE booking_date ='{$booking_date}' AND booking_slot = '9am'"; $result = mysqli_query($conn, $query) or die(mysqli_error($conn)); $num = $result->fetch_assoc(); If ($num['total'] == 0) { echo "<script> document.getElementById('9amTimeSlotRadioButton').disabled = false; </script>"; } else if($num['total'] > 0) { echo "<script> document.getElementById('9amTimeSlotRadioButton').disabled = true; </script>"; } } ?> My problem is that I cant get the Javascript line within the if statement to execute and disable/enable the related 9am radio button. Upon research into this, I have recently found out that it is not possible to do this with just Php and JavaScript, as php runs serverside and javascript runs client-side and Ajax would be needed here. So, im in a spot of bother now as one of the main selling points of this project was to be able to get this functionality working. I have a massive favour to ask of you guys, could you chime in and guide me on how to implement this functionality by using Ajax? I have zero experience in the language so I really dont know where to start. Any input at all on this topic would be much appreciated. Thanks in advance guys, Dave Ireland.
  12. I come from a .NET world. Now entering these frigid php waters. I found an example that got me a little confused. Of course, I am trying to apply OOP fundamentals to this php code but it doesn't make sense. This is the class i am talking about. <?php namespace app\models; class User extends \yii\base\Object implements \yii\web\IdentityInterface { public $id; public $username; public $password; public $authKey; private static $users = [ '100' => [ 'id' => '100', 'username' => 'admin', 'password' => 'admin', 'authKey' => 'test100key', ], '101' => [ 'id' => '101', 'username' => 'demo', 'password' => 'demo', 'authKey' => 'test101key', ], ]; public static function findIdentity($id) { return isset(self::$users[$id]) ? new static(self::$users[$id]) : null; } public static function findByUsername($username) { foreach (self::$users as $user) { if (strcasecmp($user['username'], $username) === 0) { return new static($user); } } return null; } public function getId() { return $this->id; } public function getAuthKey() { return $this->authKey; } public function validateAuthKey($authKey) { return $this->authKey === $authKey; } public function validatePassword($password) { return $this->password === $password; } } Alright, it's obvious to me that in the method findByIdentity($id) all it's doing is creating a static new instance of User. This is the first thing that caught me off guard. In .net you cannot create an instance of a static class. Now, moving on. in that line return isset(self::$users[$id])? new static(self::$users[$id]) : null; the second thing that intrigues me is the following. Since all you have in that array is a key/value collection.... private static $users = [ '100' => [ 'id' => '100', 'username' => 'admin', 'password' => 'admin', 'authKey' => 'test100key', ], '101' => [ 'id' => '101', 'username' => 'demo', 'password' => 'demo', 'authKey' => 'test101key', ], ]; how does php determine that it has to create an User object? Reflection? Which leads me to the next question.... looking at the class that it inherits from, Object, in the constructor, there's in one parameter which is an array (one of the elements of the array above). public function __construct($config = []) { if (!empty($config)) { Yii::configure($this, $config); } $this->init(); } BUT, this class in its constructor, is calling Yii::configure($this, $config) and in this method, the way I see it, Yii is adding to $this (the Object instance I am assuming, not the User one) the parameters that belong to User. public static function configure($object, $properties) { foreach ($properties as $name => $value) { $object->$name = $value; } return $object; } Seems to me like it's adding parameters dynamically to Object which will be accessed by User via the matching parameters. Makes sense? From my .net standpoint, $this in Object refers to Object instance itself, not to the User instance inheriting from it (like my friend says). I told him that's a violation of basic OOP principles and it's simply impossible. Anyone that could make me understand about this? Thank you.
  13. hello every one.... Can any one plz help me how to detect mobile device brand like samsung, nokia or micromax uisng php or javascript.... Any help will be greatly appreciated.... Thank you.. :)
  14. Hello, I use urls like www.example.com/viewpost.php?ID=123 where i am passing ID parameter and then display records from sql in PHP. Later with help of this forum I can able to use MOD REWRITE functionality in .htaaccess and able to convert as dynamic seo friendly url like www.example.com/mp3playerforsale www.example.com/carforsale Now I have the requirement that I have two pages which have ID as parameter. But both has to displayed in two different pages. example : mp3players should go to page viewpost.php?ID=123 cars should go to page viewpost2.php?ID=123 when i tried both displayed in viewpost.php where I need to display cars category in different pages. any help appreciated !
  15. Hey everyone im new to the forum, Okay so I need some help and maybe snippets on helping me achieve creating a program. The goal of this is to create a game which has the user guess which U.S. President corresponds to a randomly chosen term in office. A term (in office) constitutes a time range in which the U.S. President was the same. It turns out that the range of years of the term corresponds to a single President, but not vice-versa, because there is one U.S. President who had two terms. Generate the random term with this statement: $term = $terms[ mt_rand( 0, count($terms)-1 ) ]; so this is what i have. NOTE: THE OTHER PROGRAM'S PHP FILES ARE MADE. <?php require_once "include/Session.php"; $session = new Session(); if (!isset($session->valid)) { require_once "login.php"; exit(); } require_once "include/presidents.php"; // this is the list of the terms $terms = array_keys($term_presidents); // this is the list of all names (duplicates removed), sorted by last name $presidents = array_unique(array_values($term_presidents)); usort($presidents, "byLastName"); /* DO NOT MODIFY THE ABOVE LINES !!!!! */ $params = (object) $_REQUEST; print_r($params); /* Remaining Php handler code goes here */ ?> <!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" /> <meta http-equiv="X-UA-Compatible" content="IE=edge"/> <title>Average Calculator</title> <style type="text/css"> body { padding: 20px; } #logout { position: absolute; top: 40px; right: 40px; } /* Add more style rules */ </style> </head> <body> <a id="logout" href="logout.php">Log out</a> <h2>President Guess Game</h2> <form action="program.php" method="get"> <button type="submit" name="reset" >New Game</button> </form> <!-- Add form and presentation code --> </body> </html>
  16. I have my form created, and want to link it to an insert.php file where I can save data to database. Normally, I would have done it like this: <form method="post" action="insert.php"> Although, I have done my form a different way than usual to help security precautions(Reference: http://www.w3schools.com/php/php_form_complete.asp) <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"> Name: <input type="text" name="name" value="<?php echo $name;?>"> <span class="error">* <?php echo $nameErr;?></span> <br><br> E-mail: <input type="text" name="email" value="<?php echo $email;?>"> <span class="error">* <?php echo $emailErr;?></span> <br><br> Website: <input type="text" name="website" value="<?php echo $website;?>"> <span class="error"><?php echo $websiteErr;?></span> <br><br> Comment: <textarea name="comment" rows="5" cols="40"><?php echo $comment;?></textarea> <br><br> Gender: <input type="radio" name="gender" <?php if (isset($gender) && $gender=="female") echo "checked";?> value="female">Female <input type="radio" name="gender" <?php if (isset($gender) && $gender=="male") echo "checked";?> value="male">Male <span class="error">* <?php echo $genderErr;?></span> <br><br> <input type="submit" name="submit" value="Submit"> </form> My form's action attribute is filled with php code already, so where do I link to my insert.php file now? Can I still put a file name next to the php code that is already there? Can I do it like this, adding an onclick attribute that links to insert.php file?: <input type="submit" name="submit" value="Submit" onclick="insert.php">
  17. I have a table named download_manager, with id, FILE & DOWNLOADS columns. All I want to do is view in FLASH MovieClip the downloads column of the row with the id I specify. Will this achieve this ? <?php error_reporting(E_ALL^E_NOTICE); require('connect.php'); $body=""; $result = mysqli_query("SELECT * FROM download_manager WHERE id = 'xx'"); $data = mysqli_fetch_assoc($result); $result->close(); $body = '<b><font name="Teen" color="#009999" size="11">' . $data['DOWNLOADS'] . '</font></b> '; echo "returnBody=$body"; exit(); ?> Thanks for your help Steven
  18. I have a setup where I can do single word search and it returns the data. However, I am looking to add a multi word functionality. So far no luck. Anyone here know how to do it and point me in the right direction?
  19. Hello and thanks in advance for any advice until recently, when our pdf was displayed in the browser, the whole pdf showed up - now (within the past 2-3 months) only about 1/3 of it shows Here's the page http://www.manofsteelesports.com/nonjphp/report.php?sid=128&a=d728d31d84495231a61b35d1ad7ccdcd&b=pdf I've looked at this in both Chrome and IE the php statement we're using in the PHP file that converts the HTML to pdf is $pdf->Output(); //Outputs on browser screen Any ideas on why this is happening and how to fix it?
  20. hello eveyone.. How can i pass values from one page to another using javascript.. I can do it using php but I need in javascript or jquery... suppose take this as an example... <script src="myscript.js?uid=123"></script> if the above step is possible then plz help me out.... IF NOT THEN the second way i want is <script src="myscript.php?uid=123"></script> If the above code doesn't have script tag then i can access the value but tthe <script> tag is making me impossible to do it...... I have used this step to access the value from the above code but it shows nothing... <?php $val = $_GET['uid']; echo $val; ?> Any help will be greatly appreciated... Thank you in advance...
  21. Recently I started getting into server queries, attempting to retrieve data from game servers. I started with the source games (think of CS:S, TF2 etc etc) and it works quite well my script shown below. <?php $handle = fsockopen("udp://127.0.0.1", 7777, $errno, $errstr); stream_set_timeout($handle, 2); fwrite($handle, "\xff\xff\xff\xff\x54\x53\x6f\x75\x72\x63\x65\x20\x45\x6e\x67\x69\x6e\x65\x20\x51\x75\x65\x72\x79\x00"); $response = fread($handle, 256); echo $response; ?> https://developer.valvesoftware.com/wiki/Server_queries#A2S_INFO you'll see what is needed in order to request data. However the problem arises when I want to query an other game, that is not of the source engine. Given the picture below. It needs to be a non-blocking UDP connection, but I've got no idea how to create such request. I know that for the first 3 bytes I need: 0x4d, 0x49, 0x56, however how I do continue? Can someone help me out with PHP? Thanks in advance.
  22. I have a VPS using FastCGI (WHM/cPanel). As I understand it, in my configuration with FCGI, open_basedir must be set using a php.ini file in each user's /home/ directory (From what I've read, it won't work to do it in the global httpd.conf or global php.ini). I want to use open_basedir for improved security, as I recently had a hack that involved traversing through different user's directories. I have added this value to a user's home directory php.ini file: open_basedir = /home/USERNAME/public_html:/usr/lib/php:/usr/local/lib/php:/tmp What I want to know is, is there a way to test that this is functioning properly? How do I know if it is enforcing it as it should? Presumably I would want to try and execute a .php file in another user's directory from within that first user...however I don't know of a good way to test this. Any suggestions would be greatly appreciated.
  23. Hello Friends, I am working as a Php Developer since last 5+ years. I have strong knowledge in Php/MySql, WordPress, Opencart and Magento. You can check my portfolio here..http://phpfreelancerszone.com/php-portfolio/ Contact Us By Email:shailpatel05@gmail.com We can help on a moments notice via Skype: shailpatel05 Thanks.
  24. 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.
  25. Hey all, I have some problems with this script when i post a comment and try to refresh page in Firefox it re-send data, but in Chrome and Opera is not re-send this is all in comments.php and i include it in other file <h4 class="h3-title">Comments</h4><small><?php if (!isset($_SESSION['username'])) { echo 'You must be looged in to post comments'; } ?></small> <hr /> <?php // list all comments if (isset($_GET['id'])) { $id = (int)$_GET['id']; $list_all_comments = $comments->list_comments($id); foreach ($list_all_comments as $comm) { echo '<i>' . $comm['comment_author'] . ' - <small>' . date('m F Y h.m.s', $comm['comment_date']) . '</small></i><br />'; echo '<p>' . $comm['comment_body'] . '</p><hr />'; } } // show comment form only for logged in users if (isset($_SESSION['username'])) { // process form data if (isset($_POST['comment'])) { if (isset($_GET['id'])) { $news_id = (int)$_GET['id']; $author = $_SESSION['username']; $body = trim(htmlentities($_POST['body'])); $date = time(); if (!empty($body)) { // add_comment($author, $body, $date, $news_id) $insert_comment = $comments->add_comment($author, $body, $date, $news_id); // refresh page after adding data echo '<meta http-equiv="refresh" content="0">'; } } } ?> <form action="" method="POST"> <textarea name="body" cols="75" rows="6" autofocus required></textarea><br /> <input type="submit" name="comment" value="Submit"> </form> <?php } ?>
×
×
  • 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.