703 Topics

Member Avatar for
Member Avatar for Daneos

Hello everyone, Im very new to c++ and dont have very much experience. But Im working on a programm and for that programm I need ms sql connection. Ive already googled much but I couldnt find what I need. Now I would like to ask here if someone know where …

Member Avatar for Ancient Dragon
0
158
Member Avatar for aseel_1

Suppose I have a tow SQL tables: Fathers id | name ------------- 1 | Clinton 2 | Gates 3 | Bush 4 | Clinton Sons id | fatherid | name --------------------- 1 | 1 | bill 2 | 1 | suzy 3 | 2 | mera 4 | 2 | …

Member Avatar for filipgothic
0
208
Member Avatar for aseel_1

Salam all :) anyone can help me to understand this query in venn diagram SELECT e.id, e.name FROM emp e INNER JOIN deptid D_X ON e.empid = d_x.empid AND deptid = 'X' LEFT JOIN deptid D_Y ON e.empid = d_Y.empid AND deptid = 'Y' WHERE d_Y.empid IS NULL

Member Avatar for diafol
0
80
Member Avatar for aseel_1

Hi all , i have 2 tables first one called emp have 2 columns id and name second one called dep have id and empid and nameOfDep if i want to list all emp that have X dep (But they don't have) Y dep how i can make it ? …

Member Avatar for aseel_1
0
173
Member Avatar for mark.giles.14

Having trouble with header redirection passing variables from the url. <? ob_start(); ?> <?php require_once ("Includes/config.php"); require_once ("Includes/connectDB.php"); include("Includes/header.php"); confirm_is_admin(); $lid = $_GET['lid']; $yr = $_GET['yr']; $gid = $_GET['gid']; $pid = $_GET['pid']; $pn = $_GET['pn']; if (is_admin()) { $aid = $_GET['aid']; $query = "DELETE FROM articles WHERE article_id = ?"; …

Member Avatar for mark.giles.14
0
200
Member Avatar for rjusman90

if(isset($_GET['Id'])){ $Id=$_GET['Id']; $query = mysql_query("SELECT * FROM page WHERE ID='$Id'"); $row = mysql_fetch_array($query); $PageId=$row['PageId']; $MenuName=$row['MenuName']; $ParentMenuId=$row['ParentMenuId']; $LinkWidth=$row['LinkWidth']; $OtherUrl=$row['OtherUrl']; $Status1=$row['Status']; $OnMainMenu=$row['OnMainMenu']; $FooterMenu=$row['FooterMenu']; } ?> <form style="width:100%" action="" method="post" id="form1"> <table class="viewjob" align="center" > <tr class="tableheader"> <td align="center" colspan="4"> Update </td> </tr> <tr class="tablerow"> <td>Page Id</td> <td><select name='PageId' class="select"> <option value='0' >select …

Member Avatar for pzuurveen
0
216
Member Avatar for SimonIoa

hello i have a problem understanding how a function works for example i wrote this php code <?php $face = $Wall->Profilepic($profile_pic_path); $query = mysql_query("SELECT * FROM `messages` WHERE type ='A' AND uid_fk = '$uid'"); while($row=mysql_fetch_array($query)) { echo '<a href="'.$base_url.'roves/'.$row['msg_id'].'" ><img src="'.$face.'" class="small_face" original-title="'.$row['message'].'" ></a>'; } ?> and i named a …

Member Avatar for Borzoi
0
399
Member Avatar for ravi142

Hello everyone. Here just page refresh Counter++. $this->db->select('Counter_field'); $this->db->where('id', $id); $cnt = $this->db->get('Job_Description'); $new_cnt = $cnt+1; $data = array('Counter_field'=>$new_cnt); $this->db->where('id',$id); $query = $this->db->update('Job_Description',$data); What is wrong with above Query.. Every time i want increment and go to update results store in DB.

Member Avatar for cereal
0
132
Member Avatar for SimonIoa

I am trying to put rows from my database to a select this is the code, <select name='network' id='network'> <option selected>None</option> <?php $query = mysql_query("SELECT * FROM `countries` "); while($row=mysql_fetch_array($query)) { echo $row['name'].'<br>'; } ?> </select>

Member Avatar for SimonIoa
0
256
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 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
443
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
283
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 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 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
193
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
210
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
249
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
249
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
215
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
300
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
185
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
351
Member Avatar for Benjamin_11

![c68bc2737304743859f031861c0e27ae](/attachments/large/4/c68bc2737304743859f031861c0e27ae.png "c68bc2737304743859f031861c0e27ae") I have cretaed the data set above with a query and now I need to export ONLY a portion of it to a .csv file with PHP. The higlighted portions in the images are what needs to be exported to a .csv file. Basically, each time an account_manager_id …

0
95
Member Avatar for ankit1122

i have this code which doesnt work completely...csv file is generated but query string named as $s is not shown... <?php $count = 0; foreach($_POST as $item) { $count += (is_array($item)) ? count($item) : 1; } // echo "Items = $count"; $db=$_POST["db"]; $skills = explode(",", $_POST["skills"]); $table = explode(",", $_POST["table"]); …

Member Avatar for cereal
0
166

The End.