Tagged Questions
0
votes
0answers
9 views
how to make a variable select all when querying a database
Hey all im trying to query a database using if if/else statement and I want one option to select all results from a specific column in the database (in this case location) an the other option to only ...
0
votes
0answers
12 views
Select MAX field without repeating another
sorry for my english, i use google translator...
I have a table like this:
id / name / number
1 / John / 110
2 / Carl / 95
3 / Carl / 213
4 / Jesus / 4
5 / John / 112
6 / ...
0
votes
0answers
13 views
Get Deeper Category Items From Top Category
I need to list items from selected category(such as classified ads script).
I have infinite category table. Like this;
Category [ category_id, parent_id, name ]
And I have a items table. Like ...
-1
votes
1answer
23 views
Array to string conversion in D:\xammp\htdocs\NHC\upload.php on line 36
<?php
$conn = mysql_connect("localhost","root","") or die(mysql_error);
$db = mysql_select_db("new_meta");
if (isset($_FILES['file']['name'])) {
$File_Name = $_FILES['file']['name'];
...
0
votes
2answers
26 views
Using arbitrarily named php variable
My objective is to extract each value of 3 columns of a SQL table. Although, I want to extract these values from different tables deppending on the value of listtype that is chosen. The columns Name ...
0
votes
2answers
20 views
Retrieve values from multiple tables relationed
So, I have a table named clients, another one known as orders and other two, orders_type_a and orders_type_b.
What I'm trying to do is create a query that returns the list of all clients, and for ...
0
votes
0answers
16 views
Pull data from SQL or Excell and cycle data on webpage
I've done countless hours of searching, and I can't seem to find anything remotely related on what I am trying to do. This is a work related project, so I can give the basic idea of what I'm trying to ...
0
votes
0answers
9 views
Save items from a shopping basket into a php session variable for later use - using an array
Firstly, we have a session which runs throughout all of the php webpages.
We also have a sql database were using check boxes we can select items from the database and enter them into a shopping cart. ...
0
votes
0answers
11 views
PHP — Excel not saving correctly (COM)
I created this clsExcel to work with my excel documents. Please don't recommend PHPExcel, there's a reason I'm not using it.
It's getting to the save part and hangs. In my event viewer it's saying my ...
0
votes
1answer
17 views
Need advise generating data-tables
Working in Zend framework and using Doctrine.
I have 1 competition, concisting of several matches ( could be from as little as 4 up to as much as 50 ).
These matches usually have the same players in ...
0
votes
0answers
36 views
How can I assign a certain php variable into a checkbox value?
I'm trying to make the value attribute of a checkbox a certain value from my SQL database. It needs to print out the list of almost all values, which it currently does. I need to attach be able to add ...
-1
votes
1answer
17 views
Using paypal checkout ot add a user to sql database
I am trying to create a php file that will be called by paypal checkout and add the persons email and password to an sql database so they can login.
I found a file online but and I made my button ...
0
votes
1answer
19 views
Get last 5 item of sql results with Propel
I want to get the last 5 items of my search action. An example:
$quizzes = $user->getQuizs();
Now I would like to select the last 5 of that, is this possible with propel?
I tried ->getLast(5) ...
0
votes
2answers
49 views
How can I put two search results statement as one using a conditional statement?
I need these two separate statements to be one statement using a conditional either if or elseif or even any other conditional statement which will execute any of the two queries and render results.
...
0
votes
4answers
25 views
How can I get post data from my db - multiple fetch
<?php
if ($username = $_GET['username'])
{
$sql = "SELECT * FROM posts WHERE username='$username'";
$q = $db->prepare($sql);
$q->execute();
...
1
vote
1answer
9 views
how to connect sql server 2008 with eclipse helios using data source explorer
I'm trying to connect Sql Server 2008 database with Eclipse using database source explorer,
could you help me ?
in Eclipse->
Windows ->
open Perspective ->
others ->
Database Development ->
OK
I ...
0
votes
1answer
25 views
How do MySQLi transactions work?
Well, assume we have multiple users.
On every session start mysqli_connect is executed. Thus, every user have it's own (?) connection to the DB.
One of users fired an action where the atomic query ...
0
votes
0answers
20 views
Select last row to write graphic in MySQL PHP Program
Im changing a program in php that uses MySQL function.This program catch the row value(conexoes_total) in table where time is equal 00:00:% , and write this row in a graphic.
But this program only do ...
2
votes
3answers
51 views
Removing a file after sql execution in PHP
I am trying to read multiple .sql files and then execute them into the database. This works, although now I am in need of deleting the file after its been successfully been imported to the database.
...
0
votes
1answer
44 views
How to call PHP function using Jquery and catch return type
I want to call PHP function with the help of JQuery and I also want that Jquery code catch the return type of the calling function for further processing...........
My jQuery code is:
...
1
vote
4answers
35 views
how to join value from another table by same condition value
I've created two tables named "posts" with fields id,post_name and 'post_meta' with fields id,post_id,meta_name,meta_vale..
Then I've inserted some values like this.
in Post table:-
...
0
votes
0answers
9 views
sqlsrv_prepare and sqlsrv_num_rows
I have a prepared sql stored procedure using sqlsrv... I want to return number of rows from the prepared SP...
here is my code:
$elems_e01 = "{call lur_deped5_elems_e01(?)}";
...
0
votes
1answer
23 views
Querying SQL Database in php - Datediff?
I am building a sales dashboard and have run into a small problem which I am reasonably sure has a simple solution, but I can't quite get there.
So I have a SQL database built in SQL Server 2008. In ...
1
vote
3answers
51 views
Selecting from two tables joined by a reference table?
I am having a tough time figuring everything out & this question follows from this question, Inserting into a Table joined to another Table by a reference table?.
Well half of what I am trying to ...
0
votes
2answers
51 views
advice needed for my UNION ALL query
my table is
user: userID - userLogo
content: userID - contentID - contentImage
promo: promoID - userID - promoImage
this is my query
SELECT userID,userLogo FROM user
WHERE userID=4
UNION ALL
...
0
votes
2answers
31 views
PHP: Update DB Parse Error
I a creating a form where the user can update previously entered information in fields relative to an ID field.
However, I am getting a parse syntax error when using the HEREDOC method of displaying ...
1
vote
4answers
40 views
Mysql how to select value front of decimal
I'am a newbie.. I'm sorry if my question is repost.. i want to ask how to get value front of decimal on mysql..
here my fiddle example
i try to use FORMAT on mysql
`SELECT FORMAT(desc,0) FROM ...
-2
votes
0answers
24 views
How to dynamically generate SQL queries based on optional form fields in php?
This is probably a very beginner question, but I'm trying to figure out the best way (least amount of coding) to have my form pass only the contents of input fields which the user has filled and from ...
-2
votes
1answer
38 views
Writing a mySQL database from the ground up
I recently got an internship involving the writing of an sql database and don't really know where to start.
The database will hold the information of a ton of electrical products: including but not ...
0
votes
1answer
16 views
Yii, CactiveForm saving multiples tables in DB
im new at yii and im trying to save datas in different tables on CactiveForm.. this is my code on view:
<?php
/* @var $this UserController */
/* @var $user User */
/* @var $form CActiveForm */
...
0
votes
4answers
38 views
MySQL - Compare all values in a column and write in another column
I need to create a script that compares one field in the database (has a date stored, it's type is "TEXT" and cannot be changed DATE) to the current server date.
The dates are encoded like this ...
0
votes
2answers
46 views
MySQL query for rows in table A that don't match rows in table B
first say that my English is a bit bad. Will try to do everything possible to explain
I have two tables :
i need "clientes.id_cliente, clientes.nombre, clientes.apellido, clientes.empresa, ...
0
votes
0answers
13 views
Doctrine Undefined index: user when joining with view
I have the following models set up with Doctrine in ZF 1.12. The first is from my users table:
/**
*
* @Table(name="users")
* @Entity
*/
class My_Model_User extends My_Model
{
/**
*
* @var ...
2
votes
4answers
40 views
While loop in foreach resulting in blank page
I really can't figure out this one!
I'm trying to show data from a database in the following fashion:
A FOREACH loop that loops through an array ($jaren) of 12 values. (users can pick one of these ...
0
votes
5answers
49 views
MySQL - Ordering alphabetically, excluding “The”
I'm looking for a way to query my database and alphabetize the results, but if the entry starts with "The" to skip over it and instead alphabetize along the first letter of the next word.
Is it ...
0
votes
2answers
31 views
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'post' cannot be null
I have this codes but when I try these code I am getting:
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'post' cannot be null
this error.
I could not find any solution. I tried ...
0
votes
3answers
40 views
Mysql query and $con
$query = "SELECT id, firstname, lastname, username FROM users ORDER BY id desc";
$stmt = $con->prepare( $query );
$stmt->execute();
When I run the above code for my CRUD Single page ...
-1
votes
2answers
28 views
JSON capacity, number of objects [on hold]
How many objects can I send using a Json through Php?
In my android app I want to get the whole list of users which is in mysql, and now I only have some users, but if I have 10000 of users i would ...
0
votes
0answers
24 views
DBLIB PDO driver keeps failing when trying to connect/query Microsoft Azure SQL database
So I'm using Linux (ubuntu) and I'm trying to connect to a Microsoft Azure SQL database.
Server information:
The server address is a1a1a1a1a1.database.windows.net (a1a1a1a1a1 is a placeholder for ...
0
votes
0answers
25 views
“snapshot” of MSSQL Fastest/Most efficient way [on hold]
I have a fairly large MSSQL database (+- 200GB) sitting on SQL Server 2005. It has around 250 tables each of which contain several thousand rows.
The current methodology (yeuch) is to duplicate the ...
0
votes
0answers
6 views
Error IM014 odbc conect php sql server 2000
I get the error "IM014" when i try to connect with my System DNS
this is the code.
$conn = odbc_connect('coti','sa','dbsalitre') or die (odbc_error());
I 'm using the SQL Server Native Client 10.0 ...
-7
votes
0answers
37 views
PHP script return Warning: PDOStatement::execute() [on hold]
Warning: PDOStatement::execute() [pdostatement.execute]: SQLSTATE[HY093]: Invalid parameter number: parameter was not defined in /Applications/MAMP/htdocs/ricaAndroidAdm/TableEmpresas.php on line 106
...
0
votes
3answers
31 views
SQL not properly filtering on certain criteria
I'm having a bit of trouble with my MySQL query:
$statement = $conn->prepare
("SELECT * FROM ext where `approved` = 0
and `account-type`= 2
AND `ext-name` LIKE :search OR description LIKE ...
-1
votes
2answers
21 views
FPDF, generating pdf from mysql table for selected value
Hello friends below is my php code which generates PDF from MYSQL table(for all rows) and is working like anything, what i need is to generate report for selected rows only say for example row 1 and ...
0
votes
2answers
22 views
Outputting user status' from a database, but occationally output a users profile picture instead
My website pulls out user status updates one after another.
[status] [status] [status] [status] [status] [status] [status] [status]
But I would like it to sometimes output a users profile image ...
0
votes
1answer
8 views
Yii CListView Search with Subqueries
I am using a CListView to display my data on a page. I have a textbox for searching keywords in the query.
In my query where I build my CActiveDataProvider I have some subqueries. For Example:
...
2
votes
2answers
51 views
I can't get records from a stored procedure
I can't get records from a stored procedure. If I run from SQL Server, I get records. If I call it from .NET, I get records... but if I call it from PHP, I don't get records.
I am using PHP 5.3.3 on ...
0
votes
2answers
43 views
Sending a simple string to PHP using javascript prompt
I have a simple function in my php file mean to collect emails and send them to a database.
function add_Email_to_MarketingList()
{
global $wpdb;
$mail = $_POST['market'];
...
1
vote
3answers
32 views
Reading files from multiple directions
I am trying to make a script that reads .sql files from multiple directories in a certain folder, and then to execute them into the database.
How would I make my code below able to read multiple ...
0
votes
2answers
49 views
PHP/SQL - Query not showing all data
Here's the code:
<?php
if(isset($_POST['results']) && $_POST['results'] != -1) {
$db = new PDO('mysql:host=localhost;dbname=;charset=utf8', '', '');
...