2,570 Topics

Member Avatar for
Member Avatar for [NOPE]FOREVER

1. What exactly is a surrogate primary key? 2. Is a surrogate primary key just a made up attribute inserted into a table by the database administrator? All I know is that you use a surrogate key when there is no primary key or the natural key may not be …

Member Avatar for hericles
0
246
Member Avatar for aseel_1

Hi all , I am a new in PHP my code don't save information in db and password confirmation code doesn't work correctly this is my simple code : <?php // decleration for varible $name=$_POST['nameTxt']; $username=$_POST['userNameTxt']; $passTxt=$_POST['passTxt']; $passConTxt=$_POST['passConTxt'] ; $email=$_POST['email']; $website=$_POST['website']; $errors=0; $submit=$_POST['btn_done']; // connection to mysql $con=mysqli_connect('localhost','root','root'); if(!$con){ die('Could …

Member Avatar for aseel_1
0
394
Member Avatar for iwishimgoodasu

I do not know what seems the problem in my code. I want to add the data to my database (using windows form) but whenever I refresh my database, no updates were observed. Thank you for your help. Here is my code: public void btnSave_Click(object sender, EventArgs e) { string …

Member Avatar for iwishimgoodasu
0
237
Member Avatar for minghags

Hello! I have a problem with sorting mysql queries into pages. So i wanna set every query that is passed to screen to be divided with 30 rows per page. Here is what i come up with: <?php $con=mysqli_connect("*","*","*","*"); // MySQL connect if (mysqli_connect_errno()) { echo "MySQL: no connection! " …

Member Avatar for Adrian_5
0
448
Member Avatar for mexabet

My script has a two bugs, which I've been unable to fix. So, I need your help. Here is the file: <?php // configuration require("../includes/config.php"); // check if form was submitted if ($_SERVER["REQUEST_METHOD"] == "POST") { // type of transaction - for tracking history $transaction = 'SELL'; // validate submission …

Member Avatar for mexabet
0
308
Member Avatar for junaid_5

this is my code $totalDates = "SELECT COUNT( DISTINCT date ) FROM table_name"; $result = mysqli_query($connection, $totalDates); $totalDates = mysqli_fetch_array($totalDates, MYSQLI_NUM); echo "there are total $totalDates Distinct Rows"; i want to get the no of distinct dates from table_name but it giving me this error , what i might be …

Member Avatar for hericles
0
161
Member Avatar for Ryan_11

I am in the process of completing a php program. The issue i am having is getting the data to display on a page after submission so that the data can be printed and handed to the customers. My current code is <?php if(isset($_POST['name'])) { $date = $_POST['date']; $name = …

Member Avatar for itisnot_me
0
284
Member Avatar for zachattack05

Good morning everyone! I haven't been here in a while, but I have a question that I thought someone here might be able to help with. When it comes to accessing data from a SQL server, I know the logistics of getting that data through code, no issues there, but …

Member Avatar for zachattack05
0
445
Member Avatar for staffmbm

I'm trying to make delete row function in primefaces datatable. I'm using this method: package logon; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import javax.annotation.PostConstruct; import javax.enterprise.context.SessionScoped; import javax.faces.bean.ViewScoped; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.PersistenceUnit; import javax.persistence.Query; @ViewScoped @SessionScoped @javax.faces.bean.ManagedBean(name = "logonTest") public class LogonTest implements Serializable{ @PersistenceUnit(unitName="Webbeans_RESOURCE_LOCAL") private EntityManagerFactory emf; …

0
119
Member Avatar for Verygoodguy

I have created a table in sql server, an insert stored procedure, a aspnet webform with 5 text boxes to edit the parameter values, a label to display the output identity value from scope identity and another label to display the inserted or not inserted report from the execution of …

Member Avatar for sheejo.apsalone
0
3K
Member Avatar for gogs85

How to insert image name in database and image store in folder image with move_uploaded_file usign PDO: this is my query: $stmt = $db->prepare('INSERT INTO blog_posts_seo (postTitle,postSlug,image,postDesc,postCont,postDate) VALUES (:postTitle, :postSlug, $filename, :postDesc, :postCont, :postDate)') ; $stmt->execute(array( ':postTitle' => $postTitle, ':postSlug' => $postSlug, '$filename' => $image, ':postDesc' => $postDesc, ':postCont' => …

Member Avatar for pritaeas
0
230
Member Avatar for ryantroop

so.. Im having trouble wrapping my noodle around this... my initial thought: -- events create table Events ( id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, Title VARCHAR(512) NOT NULL, Description TEXT NULL, StartDate DATETIME NOT NULL, EndDate DATETIME NULL ); create index StartDate_OnEvents On Events (StartDate); create table EventFrequency ( …

Member Avatar for ryantroop
0
1K
Member Avatar for rpv_sen

Hi I am trying to upload excel file data thorugh .net uploading code. But i am getting an error message. can any one please help me to resolve this. **Upload.aspx** <%@ Page Language="C#" AutoEventWireup="true" CodeFile="add_residentupload.aspx.cs" Inherits="add_residentupload" %> <table class="table-list"> <tr> <td width="30%">Upload File</td> <td><asp:FileUpload ID="fupUpload" runat="server" /> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" …

Member Avatar for geniusvishal
0
1K
Member Avatar for istteffy

Guys, I am trying to learn asp, but I am stuck on this error forever... I managed to display and create new, but I can't delete and update. I was told I had to remove the ' around cid, but it still gave me another erro. can someone please provide …

Member Avatar for Blueie
0
236
Member Avatar for Blueie

Hello I have started my first ever VS Web page today and have two pages open in the software: Register1.aspx and Web.config. I am hoping to devise a simple 'new user registration form' with three fields: username, password, and email. When the 'submit' button is clicked, those three fields should …

Member Avatar for Blueie
0
293
Member Avatar for Benjamin_11

I am using the following query (thank you diafol) to group the top N rows in my data set: SELECT mgap_ska_id,mgap_ska_id_name, account_manager_id, mgap_growth AS growth,mgap_recovery, (mgap_growth+mgap_recovery) total FROM (SELECT mgap_ska_id,mgap_ska_id_name, account_manager_id, mgap_growth, mgap_recovery,(mgap_growth+mgap_recovery) total, @acid_rank := IF(@current_acid = account_manager_id, @acid_rank + 1, 1) AS acid_rank, @current_acid := account_manager_id FROM mgap_orders …

0
117
Member Avatar for My question

Database: id name 1 Supriya 2 Himanshu 3 Deepika 4 Himanshu 5 sonu 6 Sonu I am using name field to fetch the datas and my **OUTPUT** should be as id name 2 Himanshu 4 Himanshu 1 Supriya 3 Deepika what query should i use

Member Avatar for Ayrton C.
0
194
Member Avatar for My question

I am using **name** field to get the option in dropdown from database datas in my database id name 1 Resham 2 Rukshana 3 Resham 4 sindya how to write a php code for displaying the name only once in dropdown and if the option *Resham* is choosen then my …

Member Avatar for My question
0
212
Member Avatar for jeffreylee

I am trying to establish a connection with sql server but i am not able to do so. Can some one help me out?

Member Avatar for vdixit01
0
828
Member Avatar for vish_yagnik

I Have one table in sql Date Day Start Time End Time Subject Teacher 2014-06-02 Monday 2:30 PM 04:30 PM Maths Mr.Smith 2014-06-10 Tuesday 2:30 PM 04:30 PM Science Mr.Ayar 2014-06-16 Monday 2:30 PM 04:30 PM Maths Mr.Smith 2014-06-02 Monday 3:30 PM 04:30 PM Maths Mr.Smith I want to make …

Member Avatar for diafol
0
250
Member Avatar for Lethugs

Hi, I have 3 tables Description, Item, Transaction Description Item Transaction DeID Name IID Name DeID TranNo Type IID Date 1 Printer 1 Stylus T10 1 1 Repair 1 2 Monitor 2 HP 1 2 Repair 3 3 ViewSonic 2 I need to count how many printers, Monitors etc. are …

Member Avatar for Dani
0
368
Member Avatar for Lethugs

Hi, I have a data, employee attendance record with following format > 01-0002,I,4/21/2014,07:34:00 01-0002,O,4/21/2014,18:09:00 01-0002,I,4/22/2014,07:47:00 01-0002,O,4/22/2014,18:09:00 01-0002,I,4/23/2014,07:54:00 01-0002,O,4/23/2014,18:07:00 where I is in and O is out The table contains lots of records for this saves records from the start how can i search a record with no In or no …

Member Avatar for Lethugs
0
251
Member Avatar for Benjamin_11

Im using the following query with LOAD DATA INFILE: "LOAD DATA LOCAL INFILE 'file.csv' INTO table mgap_export FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' LINES TERMINATED BY '\n' IGNORE 3 LINES (@dummy,@dummy,@dummy,@dummy,Full_Name,gt_accountMgrID,Email_Address,mgap_ska_id,@gtdashboardLink, @gt_rankingLink, @gt_analyticsLink) SET gtdashboardLink=CONCAT('http://www.url.com/logind.php?id=',gt_accountMgrID), SET gt_rankingLink=CONCAT('http://www.url.com/logind.php?id=',gt_accountMgrID)"; If I remove the last variable the query works just fine, …

Member Avatar for Benjamin_11
0
216
Member Avatar for saadi06

Hi, I have a very complex query that is using mysql functions and complex logic. I have done indexing of important fields that needs to be done but I am having issue that the records keep on duplicating and I am using group by to remove this issue but my …

Member Avatar for veedeoo
0
107
Member Avatar for Benjamin_11

I am using the following [sample code](http://www.coderelic.com/2012/01/export-data-from-a-database-to-csv-excel-with-php/) to export a query to a csv file: <?php // Connect and query the database for the users $conn = new PDO("mysql:host=localhost;dbname=mydatabase", 'myuser', 'mypassword'); $sql = "SELECT username, email FROM users ORDER BY username"; $results = $conn->query($sql); // Pick a filename and destination …

Member Avatar for iamthwee
0
302
Member Avatar for EJL242000

Hello, I am trying to create a table in MySQL with the following data: $sql = "CREATE TABLE $uID ( Col0 int(10) NOT NULL auto_increment, Col1 varchar(255) NOT NULL, Col2 varchar(255) NOT NULL, Col3 varchar(255) NOT NULL, PRIMARY KEY(Col0) )"; However, I keep getting a syntax error. Can someone pls. …

Member Avatar for cwarn23
0
442
Member Avatar for [NOPE]FOREVER

I have a php/mysql project and I am currently trying to display a table into an html table through PHP how ever Only the headers are getting returned not the actual table data, here is my query plus html table <?php $result = mysql_query("SELECT * FROM store"); echo"<table border = …

Member Avatar for [NOPE]FOREVER
7
186
Member Avatar for Benjamin_11

I have the following data in a table called 'customers': accmanid custid billone billltwo 1 1 126.9 514.6 1 2 264.73 108 1 3 130.5 514.6 1 4 137.82 514.6 2 10 126.9 514.6 2 11 126.9 375.48 2 12 126.9 117.55 2 13 126.9 261.66 3 19 130.5 117.55 …

Member Avatar for diafol
0
149
Member Avatar for ankit1122

i have an array names skills in which there are various skills now i wanna create aquery like select * from tablename where skills regexp ""skill1" and skills regexp "skills2" and skills regexp "skills3"; how could i do this.. upon defining a string for concatenation php shows error....`$s=select * from …

Member Avatar for broj1
0
353
Member Avatar for Sar_1

I am trying to build a java program for user login but I am not sure if my MVC design is accurate. I have the following classes: LoginControl - servlet LoginBean - data holder java class with private variables getters and setters LoginDAO - concrete java class where I am …

Member Avatar for JamesCherrill
0
179

The End.