10,940 Topics

Member Avatar for
Member Avatar for blueguy777

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'] …

Member Avatar for matrixdevuk
0
2K
Member Avatar for safi.najjar1

Hello Guys, I coded the following and worked 100% perfectly but I want to do it ajaxly ! how to make all of this sending by ajax with animation(fadeIn,fadeOut) this my code: product.php url: product.php?id=4 <div id="product_page_desc"> <?php foreach ($products as $info) { ?> <div style="background:#fff;box-shadow: 0 0 1px #cd9db1;float: …

Member Avatar for matrixdevuk
0
502
Member Avatar for mwenyenia07

Dear Everyone, I have a central Database which I want to spread across our regional offices for faster access and performance. Requirements: 1. A transaction that is effected in a regional office must be syncronized to the central database and vice versa. 2. The databases have primary keys auto-generated. There …

Member Avatar for Taywin
0
190
Member Avatar for mexabet

I have some data in a MySQL table, and I want to use them to populate form fields, so the site's admin can edit them. This is what I have so far in modify.php, but it's not working: <?php // configuration require("../../includes/config.php"); // query users table to retrieve admin homepage's …

Member Avatar for mexabet
0
6K
Member Avatar for safi.najjar1

Hello guys I'm wondering how to update rows dynamically for instance: if cart contains one product then update its quantity and if cart contains more than one product update their quantities

Member Avatar for happygeek
-2
146
Member Avatar for berserk

I need help adding new users to a table i have made for an admin that can add or delete users from said table freely. What i have so far is an entry that can add date and time but for some reason it doesnt add the username and password. …

Member Avatar for berserk
0
647
Member Avatar for Diana Rose_1

imade this query and named it as vwOwnerAnimal. my problem is that i don't know how to display it using listview. can anyone pls help me. SELECT tbowner.owner_code, tbowner.owner_name, tbowner.owner_add, tbowner.owner_cn, tbowneranimal.a_name, tbowneranimal.a_breed, tbowneranimal.a_age, tbowneranimal.a_sex FROM tbowner INNER JOIN tbowneranimal ON tbowner.owner_code = tbowneranimal.owner_code;

Member Avatar for tinstaafl
0
208
Member Avatar for safi.najjar1

Hello guys I've coded cart class with cart items and showed cart items in a table but I had a problem when I try to update the cart.. It updates all the cart items when I'm changing quantity in one of the items **HTML** <div class="cartContainer"> <h1 class="shoppingBag">your shopping bag</h1> …

Member Avatar for safi.najjar1
0
416
Member Avatar for zoollu

Hi, I am familiar with shell script but not really have much experience. I am looking into a shell script that would do this I have 2 tables TableA id name interest ---------------------------------------- TableB id name I have to create a shell script which copies all the id,name values from …

Member Avatar for ramu1211
0
872
Member Avatar for bolfescu

Hy i have a search that now its works only if write or the first name or the last name, both didnt work....fn+ln....what i need to change?...ive tryied JOIN but nothing... if (Input::has('name')) { $name = Input::get('name'); $name = T_entity_details::where('First_Name','LIKE','%'.$name.'%') ->where('Last_Name','LIKE','%'.$name.'%','OR') ->where('Entity_Id','!=',$this->userId) ->get(array('Entity_Id')) ->toArray(); $array1 = []; foreach ($name as …

Member Avatar for bolfescu
0
194
Member Avatar for jacob21

Hi, By using **group by c3.source**,getting below result. I am trying to add condition in group by clause such that 3 rows should come 1)0+3 source result should merged 50+48 52+75 99+102 2) 4 source result contains ids having source 4 and url like '%daniweb%' source 0_to_7_days 7_to_14_days more_then_15_days 0 …

Member Avatar for Taywin
0
159
Member Avatar for newbie26

please help with the query..I want to have a conditional statement in where clause depending on the result of select Count(*) statement originally my query is: select * from StudentMaster where StudentMaster.StudId = @pStudId and exists (select * from tblFinals where tblFinals.StudId=StudentMaster.StudId) but just today, I realize that user will …

Member Avatar for h4ng4r18
0
144
Member Avatar for ashalatha

how can i delete a record from multiple tables Iam having category id in category table,and in orders table.If iam deleting in that id in category table at a time it should delete in orders table also how can i do this can anyone help me. Thanks in advance

Member Avatar for vishalkr
0
226
Member Avatar for AvinashW

dept (dept_no, dname, loc, mgrcode) emp (emp_no, ename, designation) project (proj_no, proj_name, status) dept. and emp. are related as 1 to many. Project and emp are related as 1 to many. i) Give the names of employees who are working on ‘Blood Bank’ project.`Inline Code Example Here`

Member Avatar for AvinashW
0
148
Member Avatar for marifard

Hi, I make a delete page with php to delete clients from clients table. With this page I try to delete images from gallery table. for example I wish to delete client ABC from clients table and it have three images in gallery table. here under I paste the code …

Member Avatar for Ketul_1
0
158
Member Avatar for riahc3

I have several databases located over the world, this all have the same structure, with the same tables and triggers. For clarification purposes: Site 1: database_1 (with all its tables same as other sites) Site 2: database_1 (with all its tables same as other sites) Site 3: database_1 (with all …

Member Avatar for riahc3
0
464
Member Avatar for Himanshu Chawla

** Hello i am newbiw to MYSQL .... iwant to create stored procedure in PHPMYADMIN . But when i am same procedue od MS SQL in MYSQL it is giving error . #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL …

Member Avatar for AleMonteiro
0
335
Member Avatar for safi.najjar1

hello guys i am trying to do something wierd in my query here is my query SELECT * FROM products INNER JOIN smartdevices ON products.id = smartdevices.productId WHERE products.clearName LIKE :keyword1 OR products.clearName LIKE :keyword2 OR products.clearName LIKE :keyword3 when the user enter the search phrase my php code will …

Member Avatar for safi.najjar1
0
143
Member Avatar for accra

Hey guys, i found this piece of code that is suppose to read a port on my server and write to a .txt file the gps data it get gets. am receiving nothing, am not not sure what the problem is, also am new to gps and php socket programming... …

Member Avatar for accra
1
912
Member Avatar for davy_yg

Hello, I wonder why in this specific sql table I do not see edit, copy & delete in xampp: from_stu_username date messages to_stu_username admin 0000-00-00 messages btjong ----------------------- Other Sql Table has Edit, Copy & Delete Except for messages. Here is my php code for adding the new data in …

Member Avatar for thirsty.soul
0
1K
Member Avatar for safi.najjar1

Hi guys, I have 3 classes : 1.Product(Super Class) 2.SmartDevice(Sub Class) 3.Accessories(Sub Class) so I made 3 tables in database and made productId as a foreign key for smartDevice table and accessories table so I've had a trouble thinking about what the code of CRUD will be if I used …

Member Avatar for safi.najjar1
0
351
Member Avatar for accra

Hi every one. i have built an online fleet management app in php/mysqli successfully. I now have to add a gps device to send lon,lat, speed and so on to online app. I did some reading on php tcp socket listener, but am not very clear. Do any one have …

Member Avatar for accra
0
1K
Member Avatar for Paul_26

Hello i try to update the Image using Update Query in MySQL here's the code $pic = $_FILES['photo']['name']; $sql = "UPDATE `std_login` SET `imagename` = '$pic' WHERE `std_id_no` = '$std_id'"; the File upload works, but not Stored in Database. what to do? help me please.

Member Avatar for thirsty.soul
0
2K
Member Avatar for Prithvi777

I have 2 servers.Both are masters.One is local another is live.local generates even primary keys and live generates odd primary keys.But i want these primary keys in sequential manner (like 1,2,3,4....). I have divided the primary keys into even and odd due to synchronising issues between local and live.

0
60
Member Avatar for rchawdhari

create table invoices( year int not null ,invoice_number int not null auto_increment ,primary key(year, invoice_number) ); insert into invoices(year) values(2009); insert into invoices(year) values(2009); insert into invoices(year) values(2009); insert into invoices(year) values(2010); insert into invoices(year) values(2010); insert into invoices(year) values(2010); select * from invoices; +------+----------------+ | year | invoice_number | …

Member Avatar for cereal
0
1K
Member Avatar for neeraj_shri

i downloaded mysql-5.6.17-linux-glibc2.5-i686.tar.gz for Ubuntu 13.04 what next step to install it on ubuntu

Member Avatar for JeoSaurus
0
396
Member Avatar for iConqueror

I have a form that asks the user to enter in an exam id that they want to delete from the exam table in the DB. The problem I am having is that even if the user enters in an id that does not match in the DB the script …

Member Avatar for diafol
0
269
Member Avatar for acurit1

I am trying to add new data to my mysql database using tkinter in python. Does anyone have any best practices for doing this? I have tried thus far to no avail. thanks in advance for any help.

Member Avatar for Hiroshe
0
1K
Member Avatar for nadiam

<?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']; …

Member Avatar for thirsty.soul
0
312
Member Avatar for safi.najjar1

Hello Guys I want to insert into two tables with one query in mysql the first table contains a primary key and other stuff the second table contains a foreign key and other stuff I'm wondering how this would happen ? and if so how would be the query of …

Member Avatar for catalinetu
1
267

The End.