7,368 Topics

Member Avatar for
Member Avatar for MargateSteve

On the surface, the top n per group query is a fairly common one and I have used a few variations on other projects. However, I really cannot get my head around this one and I think it is due to the number of joins. My query (at the bottom …

Member Avatar for MargateSteve
1
292
Member Avatar for Squidge

Hi all, I am putting together a CRUD. I have read through tutorials, and references. Just wanted to see if i was on the right track: <?php // root -> /classLib/CRUD/CRUD spl_autoload_extensions(".php"); spl_autoload_register(); use classLib\database\database_Connection as DB; class CRUD { private $id; #__construct to be extended public function __construct($id=null){ $this->id …

Member Avatar for diafol
0
347
Member Avatar for rayidi

Dear All, I'm facing problem with the symbols while getting the data from the table.. My output contains these ( � ) type of symbols i don't know why these coming even i declared <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> Can any one having solution for this ? Thanks in advance..

Member Avatar for pritaeas
0
1K
Member Avatar for riseguim

Hi everyone, Ok so let me start by saying I am COMPLETELY new with MySQL, I have only tried to use it for the first time hours ago. This might be an easy one for you guys... Here's my code: <?php // Grab User submitted information $email = $_POST['users_email']; $pass …

Member Avatar for rsewak
0
385
Member Avatar for Fiorentino01^

I've installed mysql 5.5 to work with php.From the workbench I tried to connect first time, impossible.I've allowed the program through the firewall,nothing.I read all the tutorials on the subject, still I don't understand one thing. How do I set admin privileges if I cannot connect? If I run the …

Member Avatar for drjohn
0
350
Member Avatar for athulram

Hi, new to the forum. Im building a site where articles can be created by staff. So is it better to save articles as html files on the server with PHP's file access methods or simply store the whole source code with all the tags in a database (MySQL). It …

Member Avatar for runde.bustamante
0
190
Member Avatar for primzon

Hello, Does anyone know how to write recursive SQL statement for hierarhic output places from next table: TABLE PLACES: id-----place----------idParentPlace 1......World..........Null 2......Europe.........1 3......Mediterranean..2 4......North Europe...2 5......Italy..........3 6......Greece.........3 7......Island.........4 8......Norway.........4 I don't know if this is totally correct SQL recursive statement: WITH recursion AS (SELECT id, place, idParentPlace, 1 AS hierarhic …

Member Avatar for Biiim
0
216
Member Avatar for Tinnin

Hi all, I'm trying to use recordset to create the following query: $query_GetCurMonthPlayerGoals = "SELECT PlayerName, Goals FROM ( SELECT PlayerID, COUNT(*) AS Goals FROM Master WHERE TeamID=$row_GetTeamDetails['TeamID'] AND MONTH(GoalDate)=MONTH(CURDATE()) GROUP BY PlayerID ORDER BY Goals DESC ) T INNER JOIN Master_Players ON T.PlayerID=Master_Players.PlayerNameCode"; The problem I am having is …

Member Avatar for Tinnin
0
138
Member Avatar for innovateuk

Though am still a learner, I have developed a small php application and planning to sell the same. Meantime, I would like to protect my script using api or something and srictly not obfuscating or encoding, or using zend frame work? Is there any easy way? using base64decode, I should …

Member Avatar for veedeoo
0
167
Member Avatar for wvoke9

Hi, I have been using MySQL to analyze quiz results. I have created a series of queries which yield particular graphs which help me in my analysis. For some reason, unknown to me, when I turn these queries into a 'Routine' the option to 'display chart' is taken away in …

Member Avatar for pritaeas
0
138
Member Avatar for code739

Hi guys, Need an effective suggestions on how to deal with this situation. Im working with php and mysql. Now the system i am creating needs to send emaill notification once a year.

Member Avatar for code739
0
261
Member Avatar for manaila

The following optimized select query select ***consecutive*** rows, i.e it chooses the first random row and the following ones will just be the ones below it: SELECT name,r1.id FROM entries AS r1 JOIN (SELECT (RAND() * (SELECT MAX(id) FROM people)) AS id ) AS r2 WHERE r1.id >= r2.id ORDER …

Member Avatar for pritaeas
0
264
Member Avatar for b.wickham

I've been having trouble with an UPDATE statement in the code below. The problem is that each time I submit the form to update an existing record in the products table, the records won't update. When I submit the form there is no error message and it redirects to the …

Member Avatar for b.wickham
0
1K
Member Avatar for Amicallef1991

Hi, I have a mysql database with some student info records. I am trying to Update a record in the db using a html form and a php script however it wont update. It doesnt give me any errors. Can anyone assit me please. Here is the code. **editingRecord.php** <?php …

Member Avatar for Amicallef1991
0
600
Member Avatar for ktsangop

Hi everyone, i would like some help with a couple of mysql queries. I have a table of data which looks like this : ![grid1](/attachments/large/2/grid1.PNG "grid1") And represents a transaction log for players of a game. The ID is the primary key (auto incremented). DATETIME is the date and time …

Member Avatar for pritaeas
0
238
Member Avatar for agz86

i have 3 tables. leave_cri:typs of leave allowd 4 an emp leave_eli:all typ of leaves leave_detail:details of leave taken by an emp i need 2 write a query 2 select data based on these 3 tables. ie) i have 2 display these in a grid. leave details from_leave_details ; leave …

Member Avatar for krishna_gadgul
0
3K
Member Avatar for Vincentas

Hi. My web hosting provide will charge me extra money if I want to do backup to my mysql database. My size of my db is very small but I've alot of tables though. What's the best way to backup my database schema and data in a way so I …

Member Avatar for mattster
0
173
Member Avatar for 2mhzbrain

i connected and migrated all the things from access to mySQL (online) using free hosting on the net, when i make my simple program to .exe, then run it on different computer, its asking for some OCX and dll files... why is that happening? my .exe program run well on …

Member Avatar for 2mhzbrain
0
275
Member Avatar for LastMitch

Hi, I'm getting this error: **Column 'id' cannot be null**. I can't figure it out why. I always **Import** the tables by using **.sql** into **MyPHPAdmin**. I only have **2** tables. One is **mypost** and the other **username**. For my **.sql** file I always have the same format with **NOT …

Member Avatar for broj1
0
5K
Member Avatar for ebc3142

Hi, I have these methods in my user class which check whether a username already exists and if not, inserts it into the database: //This function checks to see if the username entered already exists Private function check_user_exists() { $stmt = $this->_db->prepare('SELECT * FROM client_login WHERE Username = ?'); $stmt->execute(array($this->_username)); …

Member Avatar for veedeoo
0
290
Member Avatar for randomkid73

I'm attempting to make a web-based scheduling system, but I'm having trouble figuring out how to make it work in the best manner. First, the current table structure: **shifts** Shift_ID (pk) Event_ID (fk) Dept_ID (fk) Start End **shifts_assigned** Entry_ID (pk) Shift_ID (fk) User_ID (fk) DateAssigned Position Notes Where pk is …

Member Avatar for randomkid73
0
253
Member Avatar for tibor.marias

Dear Members/Guests, I have a manually created website(not by me, but by some professionals). I am desperate because of the weak SEO performance this website has. I have tried everything to increase it, but with no success. The website itself has almost 1000 festivals uploaded with pictures, events, places, content. …

Member Avatar for canadafred
0
126
Member Avatar for zjony.rashed

Hi,I can't display Multiple checkbox save value in my veiw page. Here is insert/save value details: Model --------- public function saveInstituteOfferdCourse($data = array()) { if ($this->db->insert('tbl_course_offred', $data)) { return $this->db->insert_id(); // tbl_course_offred = "Table name" } return FALSE; } ---------- Controller ---------- public function saveCourses() { $data = array(); $this->load->library('form_validation'); …

Member Avatar for veedeoo
0
274
Member Avatar for bobby08

Hello, I was wondering if there anyway to Select rows where the date column falls into a certain range? For example, heres a table [code] The date field is generated automatically by MySQL with the DATE function Heres the table: [user] . [wins]. [date] bobby.......4..... 2006-08-21 boby1.......3..... 2006-08-22 boby2.......6..... 2006-08-24 …

Member Avatar for Lavish Dubey
0
8K
Member Avatar for Vincentas

Hello, Let's say I have 2 tables: * projects * users and I need to relate them so that a user can work on one or more projects and a project can be worked by one or more users. How to implement this without having a third table ?? It …

Member Avatar for pritaeas
0
74
Member Avatar for Tinnin

Hi all, This is a follow on from my last post. Here is my current query: SELECT * FROM ( SELECT * FROM ( SELECT TeamID, PlayerID, COUNT(*) AS Total FROM Scored WHERE MONTH(GoalDate)=12 AND YEAR(GoalDate)=2012 GROUP BY PlayerID ) T GROUP BY TeamID, Total DESC ) T GROUP BY …

Member Avatar for Tinnin
0
169
Member Avatar for coolvasu

Hi everybody, i have problem in my php code (it just showing nothing....means no error no results).......can anybody tell me what is wrong with this code.....i'm new to PHP........here is my code <?php try { $config=array( 'DB_USERNAME'=>'root', 'DB_PASSWORD'=>'' ); $conn=new PDO('mysql:host=localhost;dbname=scc',$config['DB_USERNAME'],$config['DB_PASSWORD']); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); echo rand_id(); } catch(Exception $e) { echo …

Member Avatar for coolvasu
0
339
Member Avatar for Tinnin

Hi all, Regarding a football (soccer) league: I am trying to find the top goalscorer for each team in the league in December 2012. Each time a player scores a new row is created in the table "Scored" with their name in it and their corresponding team and the date …

Member Avatar for Tinnin
0
203
Member Avatar for anjerodesu

Hi everyone, I would like to ask a question about MySQL. Say, I have a database like this: database 1: articles |- id |- title |- description database 2: tags |- id |- articleID |- tag I needed to search from articles.description and tags.tag and while doing so, the searched …

Member Avatar for anjerodesu
0
317
Member Avatar for manaila

I have a couple of messages which are stored in the databases. I have an app which depending on the answer that the user gives should get the right message from db and include the user answer to the record. Example: record-> **Hello ____ Thank you for your answer**. The …

Member Avatar for pritaeas
0
148

The End.