Tagged Questions
0
votes
0answers
4 views
Jqgrid json data with codeigniter - query in controller
I am trying to set up a jqgrid and I am having difficulty in constructing the controller that generates the json data to populate the grid. I am using codeigniter 2.0+ and I am not sure how to build ...
0
votes
1answer
20 views
MySql using Like to find the highest value of a string
I don't think this should be all that complicated, but I'm having an issue building a query to pull the higher lower value from a table, where the identifier is higher.
So basically, I have a table ...
0
votes
1answer
13 views
I want to return data form a table depending on whats in another table?
I have a table passenger_table and a table users!
passenger_table
user_id j_id
1 1
34 1
54 1
users
user_id Firstname Lastname
1 Patrick Connell
34 ...
0
votes
1answer
27 views
SQL SELECT rows from one table using an array taken from another table
I need to do something like this:
$user_id = (int) get_logged_in_userud();
**$thread_ids** = $wpdb->query( "SELECT thread_id FROM $tableName1 WHERE user_id = %s), $user_id);
$iterateRows = ...
0
votes
0answers
14 views
Some values are not showing up in phpMyAdmin mySQL database
I'm using phpMyAdmin to store a database. The problem is when I make the insert query only 3 fields are fullfilled and 2 of them are ignored.
Yes, I have read other answer but no luck so far. If I ...
1
vote
0answers
29 views
Display .jpeg files from MySQL gathered with PHP form
Currently I am working on an html/php page that will display a random image and piece of text taken from a table with two VARCHAR(200) fields.
The issue is that the script will not display files with ...
0
votes
0answers
14 views
Multiple rows with forms to save in CakePHP
I am currently working on a bidding system, and I'm stuck on saving the winning bid numbers and amounts. This is cakePHP 2.4 by the way. When I go to submit a bid after editing the values it will ...
0
votes
0answers
23 views
Use bound variables in LIKE query
just going through my site and testing the forms for sql vulnerabilities and forgot i hadn't get converted my search query to use bound variables.
The addon for firefox (Sql Inject Me) is excellent! ...
-1
votes
0answers
25 views
select and join on max only if like [on hold]
Solved:
This does work.
I did this query
SELECT
`J`.`jobNo`,
`J`.`dealerTagNo`,
`J`.`tagNo`,
`J`.`totalSize`,
`J`.`rugDesc`,
`J`.`amount`,
`L`.`TagNo`,
`L`.`Location`,
`L`.`fullDate`
FROM `Jobs` ...
0
votes
2answers
26 views
Can't get PHP to pull line entry from mySQL as array
Ok fellas, I've been working with a SQL database via PHP for a couple days here now at work and I cannot for the life of me get it to work I have someone else who worked on this project and they have ...
1
vote
4answers
48 views
Handling data with 1000~ variables, preferably using SQL
Basically, I have tons of files with some data. each differ, some lack some variables(null) etc, classic stuff.
The part it gets somewhat interesting is that, since each file can have up to 1000 ...
0
votes
1answer
18 views
[Microsoft][SQL Server Native Client 11.0]SQL Server Network Interfaces: Connection string is not valid
I'm trying two methods to connect to my Microsoft SQL Server. We host our own website and have Microsoft SQL Server 2008 installed.
I've tried connecting using the server names of localhost, ...
0
votes
2answers
24 views
Getting mysqli_fetch_array data without 'moving' to next row
I have a result from a complicated sql query. The result is something like this:
player_id mail_text mail_title
1 hello talking
2 hi talking
1 how are ...
1
vote
1answer
20 views
PHPform not updating SQL Row
I am trying to update sql ROW only using member_id this is my current code.
if ($con = mysql_connect($host, $username, $password)) {
if (mysql_select_db($db_name)) {
$sql = "UPDATE ...
-3
votes
0answers
17 views
Web based Departmental Report Submission/Management with Tracking and Deadline [on hold]
Basic Background
We run a company with several small regional departments. Monthly Sales and Departmental reports (basically a fixed format form to be filled with the Monthly Numbers/details) have to ...
0
votes
3answers
44 views
Do I need to escape my data values when I pass them to prepared SQL statements?
When I use prepared statements do I have to use functions like mysqli_real_escape_string or are the executed automatically?
For example should I just use this
$stmt = $mysqli->prepare("INSERT ...
0
votes
3answers
29 views
Can't use JOIN with related entities in doctrine2
I was guided by this, and I can't understand what's going wrong.
My entities:
/**
* @ORM\Entity
* @ORM\Table(name="term")
*/
class Term {
/**
* @ORM\Column(type="integer")
* ...
0
votes
3answers
24 views
PHP Select Form Not Populating: Undefined Index
I am attempting to load some values from my SQL database based on my selected option value. However I am getting the following error.
Here is my code:
<p>
<select id = "selectedValueG" ...
-1
votes
1answer
19 views
php MySQL Selecting value from table which includes values from another table
I have a two tables
requirement- (r_id,r_description) - example value (1,The Robot must weigh less than 80 kg)
keyword - (ke_id,ke_description) - example value (1,must)
I want to select r_description ...
1
vote
2answers
45 views
AJAX update MYSQL database using function called from HTML generated from PHP
I have a php page generating and displaying a table. for the last row in the table i want to display an image with an 'onclick' function attached. this will send the username for the selected row to a ...
-1
votes
2answers
68 views
Upvote/Downvote based forums and user profiles [on hold]
I am in the early stages of developing a website and I became curious as to how an upvote/downvote code works, similar to that of reddit and stack over flow. What is the code usually written in? Im ...
0
votes
1answer
20 views
PDO error sql state 42000
I have query function in model:
public function query($qry, $params = array()) {
try {
$pdo = $this->prepare($qry);
$pdo->execute($params);
return ...
2
votes
3answers
37 views
Getting the number of rows on MySQL with SQL and PHP
I have a db with some tables like this:
- fruitsTable
id name numberOfPeople
1 apple 3
2 orange 4
3 cherry 1
- peopleTable
...
0
votes
4answers
61 views
SQL Query Syntax error?
I am trying to modify a query which results in 2 records before the modification for some reason my modification makes it not work as it return nothing.
This Query works and returns 2 record:
$query ...
0
votes
2answers
33 views
concat and insert using php using quotes
I want to add quotes to $sdatetime, so i can insert ('2013-12-1217:15:15') something like this into db. How do I go about it?
form --
<input size="16" type="text" name="sday">
<input ...
0
votes
1answer
15 views
How to make Opencart 1.5.6 urls use product name
Currently when you choose a product (Business cards) the url looks like this
http://smoothprint.co.uk/index.php?route=product/category&path=59
What would I have to change so the Url would be
...
0
votes
5answers
51 views
Is there any way to insert array element to mysql database
I am little confuse about to insert the array element in mysql
i have a array as following
$a = array(
'1' => 'a',
'2' => 'b',
'3' => 'c',
'4' => 'd',
...
0
votes
2answers
38 views
Populating an HTML select list from a PHP MySQL array
I'm fetching a list of 'actors' from my MySQL database table actors & trying to populate the result into a HTML Select box:
<?php
$query = "SELECT actor_name FROM actors";
$result = ...
0
votes
2answers
43 views
How to add a column entry in an already existing MYSQL database table?
I have a html page with a text field for email. When I enter an email ID I store it in the database. The database has 3 fields namely 'serial_no','coupon_code','email'. I already have 100 odd coupon ...
-8
votes
0answers
24 views
Script with member area and virtual money or credit? [on hold]
hey i am looking for Script with member area and virtual money or credit ?
and virtual products ! i want sell virtual products with virtual money to members
1
vote
4answers
29 views
PHP move information between SQL Tables
I am trying to move information from Table A to Table B with the following code. in the same time I want to delete the row in table B once information is moved to table A
//Move from table A to ...
-2
votes
0answers
21 views
search system having issues
i am making a search system and i have facing a problem in it
my code is
$maincat=@$_GET['maincat'];
$maincat12=@$_GET['maincat'];
$subcat=@$_GET['subcat'];
$country=@$_GET['country'];
...
0
votes
1answer
25 views
Transfer Value From One Column To Other
I Have Two SQL Table's Columns
Column A
Column B
Is there any way which only transfer 410015, From 410015,410016,410017,410018,410019,410020 (which is Column A Value) To Column B using PHP. So the ...
0
votes
0answers
9 views
Leave out discriminator part of Doctrine' generated SQL
Assume the following AbstractPage model:
/*
* @ORM\Entity
* @ORM\Table(name="page")
* @ORM\InheritanceType("SINGLE_TABLE")
* @ORM\DiscriminatorColumn(name="type", type="string")
...
0
votes
1answer
27 views
MySQL Updating enum field type vlaue
I have the following script :
UPDATE employee
SET is_active='No'
WHERE employee_id = 1
I want to update the is_active column which is of type enum from Yes to No, but when I try, I get a feedback ...
0
votes
2answers
48 views
MySQL Php Syntax Error, Check the manual
I have been having trouble with my code, and I keep getting this error.
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use ...
0
votes
1answer
89 views
Sql only selects first row
I have a login database, and i have a number of users, when i attempt to log in with the user that is listed first in the database, it works perfectly. However, when i log in with another user, it ...
-1
votes
0answers
11 views
Mysql Spatial Indexing with multiple LEFT JOIN on Large Database
Hi I have a query that I have been working on. I have used many different methods to do distance calculation. I have followed the guidelines on this page which seem to work well, however when I add ...
0
votes
6answers
50 views
MySQL INSERT query works but Data is not inserted
I just want to insert into database, but following code is not showing any error nor showing my inserted data in database. Can anybody help me in debugging this code.
<?php
$tips = $_POST["tips"];
...
0
votes
5answers
63 views
How to make db table field dynamic
i am creating plugin in wordpress for contact us form and in that i am creating fields(textbox,textarea etc...) dynamically based on my requirement. so there is no fixed number of fields. i am storing ...
2
votes
2answers
54 views
MySQL “NOT IN” Query Optimization
Optimizng MySQL queries isn't my expertise, so I was wondering if someone could help me formulate the most optimal query here (and indices).
As background, I'm trying to find a distinct visitor id ...
0
votes
2answers
24 views
Parse error: syntax error, unexpected T_VARIABLE on line 5
I am new to PHP and am encountering this parsing error. My code is:
<?php
$con=mysqli_connect("glcmcrusaders.ipagemysql.com", "cycregister", "Crusaders13!",
"registration")
...
0
votes
2answers
43 views
How to fetch the top comments?
I've searched everywhere else, but I could not find any reference or tutorials that shows you or explain a best way to show top comments (like the one on facebook, or youtube).
I have accomplished ...
0
votes
0answers
26 views
PHP Displaying an image as part of search results
0 down vote favorite
I have a search page on my site which basically has a text box which prompts the user to enter a postcode, when the postcode is entered and submit button clicked you are shown a ...
0
votes
1answer
17 views
Using column alias with PostgreSQL within PHP
When a column alias was used like below to get data from PostgreSQL, the PHP code doesn't run. However, when I don't use column alias, then the PHP code works so I know that my PHP code is correct. ...
0
votes
2answers
34 views
MySQL insert data from other table
This question is similar to my previous question except this is INSERT instead of update
I have two tables: contacts and companies.
contacts has : id, group_id, company_id, email, company
companies ...
0
votes
1answer
21 views
Get top unique results, getting odd .. results
i'm pretty new to programming and can't seem to figure out my mistake here.
I have a calendar setup, every time a user changes a day I make a new row. This way all changes are logged (again new, id ...
0
votes
1answer
32 views
Trouble displaying MYSQL Results
I'm trying to retrieve an entire row of data from my database for the user that is currently logged into my website. I then want to take the data and store each field into a variable, so that I can ...
0
votes
2answers
44 views
MySQL SELECT with decimal values
I'm trying to select a row from MySQL table that contains DECIMAL values.
When I call:
SELECT * FROM some_table WHERE submit_time='1386163272.2866' LIMIT 1
it selects the row properly. But when I ...
0
votes
2answers
54 views
How to send data to two tables with same user ID as primary key?
I am totally new to PHP and I'm trying to create a registration page. To register, a user has to create a username, password, email, which are put into a table called users.
They also enter address ...