Jump to content

Search the Community

Showing results for tags 'php pdo'.

  • 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

Found 2 results

  1. Hi guys! I've tried to insert data inside an input's value but the input goes like it is hidden, When I inspect the page it shows that there is no input inside my form. I've tried to move the code to the top of page but nothing is changed always a hidden input while it is not hidden at all as you can see below: <div class="mb-3"> <?php //Checking if submit button is clicked if (isset($_POST['submit'])) { //database cn $db = new PDO("mysql:host=localhost;dbname=centrify","root",""); $username = $_POST['user']; $stmt = $db->prepare("SELECT * FROM agencies_data WHERE agency_user = ".$username.""); $stmt->execute(); ?> <input class="form-control" type="text" name="oid" value="<?php while($item = $stmt->fetch()) { echo $item['agency_user']; } ?>"> <?php } ?> </div> I've tested a lot of placements but it doesnt work for me.
  2. As many PDO discussions / tutorials exist, I have read tons and I am stumped. I just cannot figure out why mine isn't working. Any advice is very welcome as I have a very basic understanding of PHP (learning but have to finish this form) and I don't know where else to turn. Here is the code. I am just trying to secure 2 variables passed from the page before it - $_GET['CareerID'] and $_GET['Title']. Someone mentioned that it could be the vars are called out in the sql statement or bind, and someone else said it could be the $resultSet var. I thank you for taking the time to review. CODE (X'ing out passwords): $conn = new PDO('mysql:host=xxxx;dbname=xxxx', 'xxxx', 'xxxx'); // set the PDO error mode to exception $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // Leave column names as returned by the database driver $conn->setAttribute(PDO::ATTR_CASE, PDO::CASE_NATURAL); // Convert Empty string to NULL $conn->setAttribute(PDO::ATTR_ORACLE_NULLS, PDO::NULL_EMPTY_STRING); $SQL = "SELECT * FROM careerapplicationpost,careerapplicationjobdescription WHERE careerapplicationpost.CareerApplicationPostID = '?' AND careerapplicationjobdescription.JobDescriptionTitle = '?'"; $sth = $conn->prepare($SQL); // binding parameters $sth->bindParam(':careerId', $_GET['CareerID'], PDO::PARAM_INT, 100); $sth->bindParam(':title', $_GET['Title'], PDO::PARAM_STR, 100); // executing statement $sth->execute(); $resultSet = $sth->fetchAll(); foreach ( $conn->query($SQL) as $row ) { //setup the postings echo "<h2>"; echo "<a href=\"/careers/view-career.php?CareerID=$row[CareerApplicationPostID]&Title=$row[JobDescription]\">$row[JobDescriptionDisplayTitle]</a><br />"; echo "</h2><hr />"; echo "<br />"; echo $row['Location']; echo ", &nbsp;&nbsp;"; echo $row['FullTimePartTime']; echo "<div class=\"postedon\">Posted on "; echo $row['PostedDate']; echo "</div>"; echo "<br />";echo "<br />"; echo "<strong>Summary:</strong> "; echo $row['JobDescriptionSummary']; echo "<br />";echo "<br />"; echo $row['JobDescriptionEdited']; echo "<div class=\"linebreak\">&nbsp;</div>"; echo "<a href=\"/careers/files/DigiEmploymentApp.pdf\">Please fill out an application here.</a><br />"; echo "<div class=\"clear\"></div>"; echo "<hr />"; } if (!$row['CareerApplicationPostID']) { header("Location:index.php"); exit; } $conn = null; ?>
×
×
  • 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.