98 Topics
|
|
Below is my database structure: PostUUID subid pricing Name Poscode abc1 1 100 userA 56000 abc2 2 100 userA 56000 abc3 1 100 userB 56000 abc4 2 100 userB 56000 abc5 1 100 userC 56000 abc6 2 100 userC 56000 Now I want to perform search on this table called … |
|
I am trying to save 2 photos to my MySQL database. I can only see one of the 2 photos in the database (i.e. its name) but I see the 2 photos in the folder I store my photos. ( A picture of how the database looks like is attached.) … |
|
Hello. I want to create a database on my pc localhost and then want to use PDO to connect with that database to creating table and so on... What should i do? |
|
Hello. I'm new to PHP, i've started it yesterday. I want to creat a simple CMS with (PHP and PDO), what should i do? I'm going to start with creating the CMS core. I want to create sth like a simple wordpress. What should i do? Where should i start … |
|
Hi, Please help me to resolve my Script Redirection problem. Actually i have developing simple crm application php using pdo->prepare. this is working fine in localhost. but what is my problem means redirection is not working, when i uploaded to server. for refernce i hereby attached . please help me … |
|
Hi guys, I'm trying to connect my new project with PDO, and for simple reason witch i don't know and i've no idea i'm getting connection failedSQLSTATE[28000] [1045] Access denied for user 'www-data'@'localhost' (using password: NO) I tried everything was in my mind, i tried log to mySql by terminal, … |
|
Currently I have form with couple of fields and field for image. I have done with the part of field storing but don't know exactly how to store image path with PDO and can't find good tutorial. All I found was how to store image into DB instead of path. … |
|
i have a database table with fields mobno1 and mobno2, first i would like store all the values of field mobno1 into var1 and field mobno2 into var2 by using comma seperator and pdo. my code is as follows. $pdo = Database::connect(); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $sql = "SELECT mobno1,mobno2 FROM custreg"; … |
|
Hi. so i have this div like so: ![d69e97a4413c033f6390ecaea54c6c8d](/attachments/large/4/d69e97a4413c033f6390ecaea54c6c8d.jpg "d69e97a4413c033f6390ecaea54c6c8d") see the "Add Spouse" link, when clicked will display another div: ![99b4077223bdea75c7de5b15af9b634b](/attachments/large/4/99b4077223bdea75c7de5b15af9b634b.jpg "99b4077223bdea75c7de5b15af9b634b") the edit spouse works by submitting the data wihtout refresh using `$.post`: $(document).ready(function(){ $("#submitSp").live("click", function() { var id = $("#contactid").val(); var ssalut = $("#spouse-salute").val(); var sfname = … |
|
hello. i got this error and i have no idea why or what is going on. could someone explain in layman's term please and help me out. > Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'event_id' cannot be null' in /home/dhsbnet/public_html/ems/add_guest.php:36 Stack trace: #0 … |
|
hi, i have an import csv script but it does not get entered into the database. only "uploaded successfully" and the data is echoed but nothing in the database is something wrong with it? and is it sql injection safe? <?php if(isset($_SESSION['sess_user_id'])) { if (isset($_POST['ubmit'])) { require "connection.php"; $session = … |
|
how to convert this old fastioned mysql statements to pdo? <?php error_reporting(0); define("host","localhost"); define("user","root"); define("password",""); define("db","pass2"); $connect_db=mysql_connect(host,user,password) or die("cannot connect"); mysql_select_db(db, $connect_db); $username=strtolower(addslashes($_POST['username'])); $password=strtolower(addslashes($_POST['password'])); $sql="SELECT * FROM users WHERE username='$username' AND password='$password'"; $result=mysql_query($sql); $row=mysql_fetch_array($result); $count=mysql_num_rows($result); if($count==1 && $_POST['userlevel'] == "admin") { session_start(); $_SESSION['id']=$row['id']; header("location: admin.php"); } else if($count==1 && $_POST['userlevel'] … |
|
<?php if(isset($_POST['login'])) { require 'connection.php'; include 'password.php'; $email = $_POST['email']; $password = $_POST['pass']; $query = $dbh->prepare("SELECT id,name,email,password FROM users WHERE email = :email"); $query->bindParam(':email', $email, PDO::PARAM_STR); $query->execute(); $userData = $query->fetch(PDO::FETCH_ASSOC); $userEmail = $userData['email']; $hash = $userData['password']; if(password_verify($password, $hash) && $email == $userEmail) { session_start(); $_SESSION['sess_user_id'] = $userData['id']; $_SESSION['sess_name'] = $userData['name']; … |
|
I'm implementing something similar to a shopping cart - a "my favorites" page for products. Users can click on an "add to favorites" link and add products to a favorites table from which they can view the details of those products at a later time. There's no purchase on the … |
|
hey guys. i have this table that lists contacts that are stored in database. the data is selected from 2 tables using join which i have already got working: SELECT c.contact_id,c.salutation,c.fname,c.lname,c.dob,c.houseadd,c.personalno,c.officeno,c.email,c.spouse,c.child, s.spouse_id,s.s_salutation,s.s_fname,s.s_lname,s.my_spouse FROM contact1 c LEFT JOIN spouse1 s ON c.contact_id = s.my_spouse what im having trouble with is selecting … |
|
hello. I have a table populated by name. The names are links when clicked will pop up a form for editing. each input (for editing) is populated by the equal value from database but im having trouble with one particular text box. this text box is for date of birth … |
|
Hello. I have and event.php page and del_single.php page. event page has a form: <form action='del_single.php' method='get'>//<-i already have the method as get <input type='hidden' name='event_id' value='$id'> <input type='checkbox' name='check[]' class='check' value='$id'> <a href= '#' value='$id' name='e_n' onclick='getsum(".$id.")' >$name</a> <label>$formatDate</label> <input type='submit' name='del_single_event' value='Delete'> </form> as you can see i … |
|
hello. i have a contact page that has a table populated by data from database. when a user clicks on a name a popup appears with that names data so user can edit/update. in that popup there is one drop down named salutations. say that drop down is not edited … |
|
Hey guys, so im wondering if theres a way to insert 2 input values into one column in PDO? coz in mysql_* i just did something like this and it worked: INSERT INTO tablename VALUES ('input1 input 2', 'input3'); pdo i tried : $event = $dbh->prepare("INSERT INTO event(event_name,start_event,end_event,event_venue) VALUES('$name', CONCAT_WS('$dstart', … |
|
Hello, I am having issue connecting my Access database to my PHP site via ODBC. Here is what I am doing: <?php $dbName = "F:\Data\Web\_Home\TickSys\TickSys.accdb"; if (!file_exists($dbName)) { die("Could not find database file."); } print "Found DB File."; $db = new PDO("odbc:DRIVER={Microsoft Access Driver (*.mdb, *.accdb)}; DBQ=$dbName; Uid=; Pwd=;"); ?> … |
|
A while ago I explained how you could tag articles (see [this thread](http://www.daniweb.com/web-development/php/threads/387961/php-code-to-show-related-posts-on-a-blog)). Now you get a full working example. This code and the SQL script is also available on GitHub. The attached MySQL dump needs to be imported into your database, and you must update the credentials in the … |
|
<?php if (isset($_POST['Login'])){ $Username = $_POST[ 'UserName' ]; $password = $_POST[ 'Password' ]; $user = 'localhost'; $pass = ''; $db = new PDO('mysql:host=localhost;dbname=ovs', $user, $pass ); $sql = "SELECT * FROM Voters WHERE UserName=:UserName"; $query = $db->prepare( $sql ); $query->execute( array( ':Username'=>$UserName ) ); $results = $query->fetchAll( PDO::FETCH_ASSOC ); foreach( … |
|
<link rel="stylesheet" type="text/css" href="admin/css/style.css" /> <?php include('dbcon.php'); include('header.php'); ?> </head> <body> <div class="navbar navbar-fixed-top"> <div class="navbar-inner"> <div class="container"> <a class="brand"> <img src="admin/images/dee.png" width="150" height="50"> </a> <a class="brand"> <h2>UNITOUCH GLOBAL ONLINE E-VOTING</h2> <div class="chmsc_nav"><font size="4" color="white">Uniquely Touching The Universe</font></div> </a> <?php include('head.php'); ?> </div> </div> </div> <div class="wrapper_admin"> </br> </br> </br> … |
|
I have some code that I edited for importing csv into mysql using PDO to bind parameters. I thought it was working before, but tested it again and the issue I have is that only one line (the fourth line) of the csv file is getting imported. The first line … |
|
The following code unable to insert null or blank value into table called custreg i.e. $sagentid and $sagentname. if(isset($_POST['Submit'])){ $reg_no=$_POST['reg_no']; $firstname=strtoupper(str_replace(',', '' , $_POST['firstname'])); $lastname=strtoupper(str_replace(',', '' , $_POST['lastname'])); $mobno1=$_POST['mobno1']; $mobno2=$_POST['mobno2']; $address=strtoupper($_POST['address']); $city=strtoupper($_POST['city']); $dateofjoin=$_POST['dateofjoin']; $regfee=$_POST['regfee']; $magentid=$_POST['magentid']; $sagentid=$_POST['sagentid']; $skimcity=$_POST['skimcity']; $skimyear=$_POST['skimyear']; $skimname=$_POST['skimname']; $cust_fullname = $firstname.' '.$lastname; $pdo = Database::connect(); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $sql = … |
|
Hello Community, I'm trying to connect to my database using PDO but for some reason it keep coming back saying "Undefined variable: db_c" db_c is the variable I've chossen for the name of my database connection. I've placed the database connection in another file, and I'm trying to connect to … |
|
I am new to PDO, i am trying to insert values into database table. but the script is not inserting any values nor displaying error message.help me to fix this issue. <?php require 'include/database.php'; require 'include/settings.php'; if ( !empty($_POST)) { // keep track validation errors $firstnameError = null; $lastnameError = … |
|
Hello Community, I have recently been having a big of a look into connecting to a database using PDO but I'm not too sure what I should stick with, the normal way to connect to a MySql database or should I start using PDO. What would be better to use? … |
|
Here, i'm trying to fetch the image from database. In my database i can see a image file size ([BLOB - 62.3 KiB]). But, it didn't work. i didn't get any error here. i'm confused where i made a mistake here? <?php include('config.php'); ini_set('display_errors', '1'); error_reporting(E_ALL); try { $stmt = … |
|
Recently i've rewritten my code to PDO from mysql query. Insert, fetch, update, delete everything working fine. But, pagination not displaying in my page. Before i've used mysql query. In that time pagination worked perfectly. Now, i've changed my codes into prepared statements. pagination not dispalying i don't know what … |
The End.