0
votes
2answers
21 views

Hardcoding Arrays and Objects or populate from Database?

At the present moment I am putting together a product website for my company featuring about 80 or 90 unique products with various characteristics. Initially, I hard-coded a multidimensional array ...
0
votes
2answers
19 views

Insert row and check the contraint error: is this correct?

Okay, think about this: you have a table with a column that must have UNIQUE values (or a multiple-column UNIQUE index). In your PHP script you have to insert a row in that table. Currently I'm doing ...
2
votes
2answers
48 views

String seems to end query

I am storing user's liked pages from facebook in my postgres database, one of them being Sinead O'Connor's page. It seems like when it gets to the apostrophe, it terminates the query beacuse the ...
-1
votes
0answers
21 views

How make CRUD of one to many in grocerycrud?

I have tables like this user id ,name user_email id ,user_id,email user may have multiple emails.How can i do CRUD operation of these type of data in codeigniter grocerycrud?I tried this but ...
0
votes
5answers
26 views

array grouping which contains same fields

I have an array which contains following values. array( 'dates' => array( (int) 0 => '2013-04-22', (int) 1 => '2013-04-23', ), 'publisherName' => array( (int) 0 => 'Comp1', ...
0
votes
1answer
46 views

multy databases for clients [closed]

I need help with databases MySQL. I am building a Customer Management System where more than 1000 users will use this system and each user will have their own clients which in turn they can have more ...
1
vote
2answers
42 views

Error :Not storing ID in DataBase

actually I am storing the three Values in Data Base,it successfully storing date, path but not storing the gallery id, here is my code I am using <?php ob_start(); session_start(); ...
0
votes
0answers
29 views

array grouping data which comes from db model [closed]

I have a db model which returns daily company num_subs; array( 'date' => '2013-04-23', 'comps' => array( (int) 4 => array( 'name' => 'Comp1', 'total' => array( ...
3
votes
5answers
67 views

best practice to count record in MySQL + PHP [duplicate]

I want to check weather number of record > 15 for a condition. What is best practice to speed up the query? 1) $query="SELECT `id` FROM `table` WHERE `name`='$name' AND `usage` > '$limit'"; ...
0
votes
0answers
7 views

Reading .docm file with check boxes and feed the data in database

I have a .docm file which has some text fields and check boxes. I want to parse that file and feed the content of that file into database depending on which check boxes are checked and which are not. ...
0
votes
2answers
24 views

Remote MySQL Server connection w/PHP

I need to connect to an external MySQL database and fetch some data. I have a few concerns about it: Connecting to a remote server will increase the loading time of the page, I want that to be the ...
-1
votes
0answers
37 views

Variable not connecting to database [closed]

I wrote this code today but im getting this weird bug from it so at the start it tells you that your building level is 0 even though it says in database one. At this point you would think its a ...
-1
votes
1answer
27 views

Convert this date string to DATETIME or TIMESTAMP with PHP

I'm using the Beanstream Payment API, and the response comes back with the following date format: 5/21/2013 3:51:28 PM What would be the best way to convert this in order to store it as a TIMESTAMP ...
0
votes
1answer
38 views

Codeigniter - loading images from browser

I've made an upload form using CI. Now my photos are uploaded in C:\xampp\htdocs\ci_new\uploads*.jpg I want these images to be accessible from the web, so i can add their path to my database, but ...
0
votes
2answers
39 views

Fastest MySQL row rank of big table

Info: I have this table (PERSONS): PERSON_ID int(10) POINTS int(6) 4 OTHER COLUMNS which are of type int(5 or 6) The table consist of 25M rows and is growing 0.25M a day. The distribution of ...
-1
votes
2answers
66 views

PHP Not Inserting Variable Into mySQL Query

I am having trouble getting one of my variable to be successfully inserted into my mySQL query. Here is the query string: $strShipMethodInfo = "SELECT BAMMDD, BAYY, BAXXX, ORDNUM, SHPNUM, \"SHIPMENT ...
2
votes
1answer
26 views

Connecting PHP5 to a Frontbase Database

Is there a way to connect PHP5 to a Frontbase database? There seems to be an included connector, but it looks like that is not available anymore in PHP5: http://php.net/manual/en/book.fbsql.php
0
votes
1answer
64 views

Need, recommendations on choosing a good database driver [closed]

I'm almost done with the html/css side of my site and want to add database that will allow users to save profiles and search it using PHP search engine. However I've never worked with MYSql before and ...
-9
votes
1answer
53 views

Gettign warning in mysql_query and mysql_fetch_array [closed]

I have tried many times, but still cannot solve the problem.. wt can i do to display the data from database into a table? Warning: mysql_query() expects parameter 1 to be string, resource given ...
1
vote
1answer
49 views

How to use sessions on the database.php file

What I would want to do is to switch between development_db and local_db. in the index page, there is a list of databases that i can choose from if i click a database name on the list, the whole app ...
-4
votes
4answers
55 views

PHP SQL syntax error while connecting to DB [closed]

Just testing something really simple on my website <?php mysql_connect('mywebsite', 'username', 'pass') or die(mysql_error()); mysql_select_db('dbname') or die(mysql_error()); ...
0
votes
1answer
31 views

Marking few items from a list based on a database

I have a list of n items(in multiple categories) like Category A 1 2 3 Category B 1 2 .... and when a user logs in, I know m (m <=n) of them should be marked ...
0
votes
0answers
13 views

Custom table Wordpress to CSV using php in a plugin

I tried to build a plugin for Wordpress (practicing purposes) and what I wanted to do is that I can download a csv file when I click a button. Whenever I click the button I redirect to the following: ...
0
votes
1answer
32 views

Serialize multiple data from database of same column

I'm new to PHP and using serialized data, I have a Database which has a 2 tables, user & character. characterId has a relation with userId. An user has 2 characters, so I wanted to get the data ...
0
votes
6answers
42 views

How to add contents of file to MySQL query inside php

I'm using the following php query to install tables in my CMS system: $q=new mysql(" INSERT INTO `adm` (`id`, `login`, `adm`, `passwd`, `czas`, `logged`, `ip`, `email`) VALUES (0, 'admin', 1, ...
0
votes
2answers
40 views

PHP Get value from database into selectbox

I have a problem to show my database values into a select box. Here is my code <select name="bugsolver"> <?php if(count($yourBugs) > 0) { foreach( $emails as $key=> ...
0
votes
1answer
26 views

Gathering information in 1 row using related tables

I am trying to build my database using related tables. I am getting the right output from the database, however - Since the user is the same, and the only change in data is the courses, I would like ...
0
votes
4answers
27 views

post not completely posted PHP

I have a select value 'post', when someone wants to change the status of the post from unsolved to solved they have to choose a post en than click 'change to solved' The problem is when I click on ...
0
votes
1answer
19 views

Use Redis for a timeout queue or leaderboard

I want to use Redis basically like this, if it (hypothetically) accepted SQL: SELECT id, data, processing_due FROM qtable WHERE processing_due < NOW() where processing_due is an integer ...
3
votes
1answer
36 views

Find the nearest postcodes to given postcode using ordance survey easting and northing system

I have a database table of uk postcodes that has 4 fields postcode, east, north, pqi example values: ST1 6BQ, 388605, 349057,10 Primary key is postcodes and east and north are both int(11) ...
1
vote
2answers
29 views

(PHP) MySQL random rows big table with order by and certain range

I have this table: person_id int(10) pk fid bigint(20) unique points int(6) index birthday date index 4 FK columns int(6) ENGINE = MyISAM Important info: the table contains over 8 million rows and ...
0
votes
6answers
80 views

Is this a good way to sanatize php $_POST inputs? [duplicate]

I have been using this code on my website for a long time, and just want to make sure I am correctly sanatizing my PHP $_POST inputs... foreach($_POST as $key=>$val) //this code will sanitize your ...
0
votes
2answers
50 views

If statement error with variable

I have had this problem for a while and finally i narrowed it down to what it is (I think). I am trying to put a limit on a income and the limit is $storagecap each $warehouse is = to 500 $storagecap. ...
0
votes
3answers
64 views

Splitting data into two tables

I want to create a table with this info: ID bigint(20) PK AI FID bigint(20) unique points int(10) index birthday date index current_city varchar(175) index current_country varchar(100) index ...
0
votes
0answers
20 views

How to separate the result of sql-query in different arrays to put each one in a different div [closed]

I have a website with 3 separate divs on center. I need to put in there information of a DB query. Then, how can I separate the mysql fetch array into diferents arrays to put each one in each div?
-3
votes
1answer
39 views

mysqli_real_escape_string() PHP error inserting a file into a database [closed]

Im trying to insert a file into a table but im getting the following error with the code bellow: Warning: mysqli_real_escape_string() expects exactly 2 parameters, 1 given here is my php code: ...
0
votes
3answers
66 views

Database most common entries query

having had assistance that helped show result, its not showing the results as i need them. I have this Table name = power Column names = power1, power2, power2, power4, power5 $res = ...
-4
votes
2answers
34 views

Convert result from PDO::fetchAll() to array like [closed]

I have a list of names from my database. I'm trying to convert the result from the PDO::fetchAll() function to get a result like a string: "name1","name2","name3" etc. I don't know if you know what ...
-3
votes
3answers
88 views

Error insert statement PHP [closed]

I am having a problem with my database handler class, i think. I have a form tag in my index.php file, which calls a function in inc/function.php, which then saves the form data to a table in the ...
1
vote
1answer
47 views

Php unit-testing sessions

Ive been looking around on how to test sessions.. iven't really found any thing helpful... $user_id = $_SESSION['user_id']; $login_string = $_SESSION['login_string']; $username = ...
-1
votes
2answers
56 views

Store array into database [closed]

I have a database can record which user apply the course the apply table like this id post_id user_id 1 3 56 2 2 33 3 3 78 4 3 99 however I am thinking to change user user_id into ...
0
votes
1answer
33 views

PHP Databases PDO connections

Hey guys im having a little trouble with the PDO in php as the error it is returning is an undefined index. The code for the function and query and return of result is this: function ...
1
vote
1answer
22 views

return same uid and email for all users in mybb

Hi i have a class login for check username and password of MYBB from external script its seems work but with small problem. for different users the result return same uid and email for all users (the ...
0
votes
2answers
44 views

Approving information prior to storing in database?

I am developing a web-based iPhone app and possibly a PC friendly website version as well. The goal here to to allow users to submit a form where specific input values would be stored into a table in ...
0
votes
3answers
43 views

Can someone tell me what i did wrong here [closed]

< mysql_query("INSERT INTO beta_testk (id, entrancex, entrancey, entrancez, exitx, exity, exitz, adress, owned, owner, value, hint, virtualworld, lock, rent, rentabil, takings, level, freeze, ...
-2
votes
0answers
20 views

Using getUserMedia to take a picture and then store it in a data base [closed]

I've been playing around with the getUserMedia API for a while now. My development skills are not the best but I like to play around. What I want to be able to do is use the getUserMedia API to take ...
0
votes
1answer
26 views

PHP- select specific row from MySQL database

I Need to select a specific row from a MySQLi database based off of a value in it. For example I have a Table with a column named "house", and under that column there are maybe 5 rows with the title ...
0
votes
0answers
35 views

best way to store image references in text using mysql/php

I have a text that contains multiple images. Imagine it to be like I like ((image1)) , ((image2)) and ((image3)) I am storing text in table Statements St_ID|Text I'm storing image path in ...
0
votes
4answers
43 views

PHP PDO: Syntax error or access violation (Help) [duplicate]

I have problem with PDO and can't find the solution: My function: public static function create($position, $name, $mail, $mailtext, $confirmed, $key, $formid) { global $database; try { ...
0
votes
0answers
19 views

Delete & Edit data from DB (php & modx)

I need to get data from db and links (or buttons) which will do DELETE and EDIT options. Now i've the following code (modx snippet) <?php global $modx; $output = ''; $result = ...

1 2 3 4 5 149
15 30 50 per page