I am Looking for a Function that insert "Any" form values to mysql , update or delete with php. (or can we do this with one function?)
(not OOP)
I have found a function here:
example: get all fields of form and ınsert into database.
Thanks in advance
...
I have some financial values stored as text in a mysql db. the significance of financial is that negative numbers are stored enclosed in paranthesis. is there a way to automatically get the numeric value associated with that text. (like '5' shoudl be retuned as 5 and '(5)' should be returned as -5)
...
I am trying to set my columns default date time to system datetime.
It shows me an error
Invalid default value for
'InsertionDate'
alter table `vts`.`tblpickpoint`
add column `InsertionDate`
datetime DEFAULT 'Now()' NULL after `PickPointLatLong`
...
Here's my code:
if Request.Form("authorize") <> "" and request.form("delete") <> "true" then
post_ids = Request.form("authorize")
ids = split(post_ids, ",")
For i = LBound(ids) to UBound(ids)
sql = "update tbl_comments set authorized = 'true' where comment_id = " & ids(i)
pageDB.execute(sql)
Next
m...
I want to make a little php poll. The script should ask the users a question they can only answer by numbers from 0-999. After pressing the submit button the data should be stored into mysql. So I just want to know how much users choosed the same number (in percent). It's a simple poll but I don't want any output to be shown.
...
I am looking for few global variable in mysql which are equivalent of sql server.
I want the whole list
eg.
Sql Server Equivalent
@@error ---
@@Identity ---
etc.
Basically right now I want to know what are the equivalent variable of @@error and @@identity.
But it will be helpfull if u could provide some other variable ...
I've got a huge bunch of flights travelling between airports.
Each airport has an ID and (x,y) coordinates.
For a given list of flights, I want to find the northernmost (highest x) airport visited.
Here's the query I'm currently using:
SELECT name,iata,icao,apid,x,y
FROM airports
WHERE y=(SELECT MAX(y)
FROM ...
Hey,
I have always tried to have an integer primary key on a table no matter what. But now I am questioning if this is always necessary.
Let's say I have a product table and each product has a globally unique SKU number - that would be a string of say 8-16 characters. Why not make this the PK? Typically I would make this field a uni...
Hi all and thanks in advance to all for this
I tired and was unable to find the answer i am looking for an answer. my problem is that i am unable to update the values enterd in the form. I have attached all the files i'm using MYSQL database to fetch data.
what happens is that i'm able to add and delete records from form using ajax an...
how do you import data from an xml document to mysql having difficulty do this does anyone know to do this
...
Hello
I'm creating a database structure. I have to store ingoing and outgoing messages and i'm wondering wich is the best way to do this.
2 separated tables or the same tables with an ENUM('in', 'out') column ?
Any suggestion ?
Thanks.
...
i'm trying to learn php/mysql.
inserting data into mysql works fine but inserting those with apostrophe is generating an error. i tried using mysql_real_escape_string, yet this doesn't work.
would appreciate any help.
<?php
include 'config.php';
echo "Connected <br />";
$auth = $_POST['author'];
$quo = $_POST['quote'];
$author...
I am running Zend Server,Zend Studio (Trial versions) on Ubuntu 9.10. I am also using xampp to do most of my development. I plan to use Zend Server only to do URL profiling to know function level performance of my code. Is it possible to configure Zend Server to use XAMPP's MySQL database instead of installing a new mysql instance for Ze...
To explain by example, take two tables, A and B
Table A
id foo
1 x
2 y
3 z
Table B
id aid bar
1 3 50
2 1 100
An example join
SELECT foo, bar FROM a, b WHERE a.id = b.aid;
Garners a result of
foo bar
z 50
x 100
What I would like to do is get all values of foo and for any instances where there isn't a...
So I have a database with a few tables.
The first table contains the user ID, first name and last name.
The second table contains the user ID, interest ID, and interest rating.
There is another table that has all of the interest ID's.
For every interest ID (even when new ones are added), I need to make sure that each user has an entr...
I have a strange problem,
I am trying to order the output of a set of records by a field called displayOrder. Now even though record A has a displayOrder of 2 and record B has a displayOrder of 1000, record B still shows up before record A. Here's my select statement:
SELECT * FROM items ORDER BY displayOrder ASC
It works fine until ...
i need to get a query where the elements are displayed in case the first letter is E (the word is electronics).. i have tried with the following :
mysql_query("select * from nested_category where name like '[A-F]%'");
Edit : its like i need to choose all the elements for which the first element lie between A & F .. I need all the ele...
I have a table which stores test results like this:
user | score | time
-----+-------+------
aaa | 90% | 10:30
bbb | 50% | 9:15 ***
aaa | 85% | 10:15
aaa | 90% | 11:00 ***
...
What I need is to get the top 10 users:
user | score | time
-----+-------+------
aaa | 90% | 11:00
bbb | 50% | 9:15
...
I've come up w...
Hello,
Let's imagine that we have table items...
table: items
item_id INT PRIMARY AUTO_INCREMENT
title VARCHAR(255)
views INT
Let's imagine that it is filled with something like
(1, item-1, 10),
(2, item-2, 10),
(3, item-3, 15)
I want to make multi update view for this items from data taken from this array [item_id] => [views]
'1...
For clarification, are you able to use MySQL this way to sort?
ORDER BY CompanyID = XXX DESC
What I am trying to do is use one sql query to sort everything where X = Y, in this case, where CompanyID = XXX. All values where CompanyID is not XXX should come after all the results where CompanyID = XXX.
I don't want to limit my query but...