Jump to content

2minutes2midnight

New Members
  • Posts

    2
  • Joined

  • Last visited

2minutes2midnight's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have a basic table where I am trying to retrieve records that are filtered by a form request. Here is the code I have... $ps = $pdo->prepare("SELECT * FROM `Products` Where `Vendor` LIKE concat('%',?,'%'); $ps->execute(array($_POST['Vendor']));; echo "post=" . $_POST['vendor']; ////Displays correct data from form request $count = $ps->rowCount(); echo "Count=" . $count; ////Count = 0 although I know for a fact that there is 1 record that should be in there ////Used for display of records foreach ($ps as $row){ echo $row, PHP_EOL . "xxx<br>"; } Where is the incorrect code? I am new to php and pdo. Thank you in advance K
  2. I was an ASP programmer and now trying to convert to php. I cannot get my driver to connect to the database. The issue is the same if I use PDO or the older method. Here is the connection string... try { # MS SQL Server and Sybase with PDO_DBLIB $DBH = new PDO("mssql:host=$hostname; dbname=$database;" , $username, $password); echo "Connected to Test<br>"; } catch(PDOException $e) { echo "Error=" . $e->getMessage(); } Here is the result... Error=could not find driver I have found this page and done everything on it but still does not connect.... http://stackoverflow.com/questions/2852748/pdoexception-could-not-find-driver Any ideas?
×
×
  • 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.