The query below
SELECT
<output name="c.name" title="Name" />,
<output name="c.reference" title="Reference No." />,
<output name="i.idinvoice" title="Invoice ID" />,
<output replace="(SUM(v.quantity * s.charges))/COUNT(i.idinvoice)" />As Invoice
<output replace="p.amount" />AS Amount,
<output replace="p.idpayment" title="Payment ID" />,
...
Hi.
New to mysql and php, so forgive any obvious stupidity, please!
One of mysql tables has category fields, indexed from a table of categories. Each of the categories is named category_1, category_2, category_3, etc.
I'm assuming that can't I use a wildcard to search these categories, like:
'SELECT * FROM products_table WHERE cat...
i want a simple example of if clause in mysql. i don't want to consider else case,only if clause
...
I'm creating comments stored in a MySQL database.
I'm logging the php time function time() as the comment is posted. That way it's displaying a message such as... "comment... posted 4 seconds ago" and if I refresh the page 2 minutes later it'd display "comment... posted 2 minutes ago"
Here's how I am entering time() into the database ...
Sorry because this is a noob question. I'm new with MySQL:
I wrote a query like this:
SELECT
u.userid, u.alias, g.company_name,
v.endtime - v.begintime AS duration,
u.status, u.service_starttime,
u.service_expiretime, v.begintime, u.email
FROM
company_users c, company_groups g INNER JOIN
user_info u INNER JOIN vfon_l...
Hi,
I am trying to develop billing system for asterisk but i dont know howto start.Is there any suggestion for this?I have looked at free billing systems for asterix but their systems are very complicated and i asked here.
Thanks for advance...
...
I am trying to retrieve two sets of information (the red and blue portions of the diagram in the one query.
I thought I could do it using the sql as stated below but it does not return me anything when TableC has no records. If TableC has no records, I would still want this query to return me the results as indicated by the BLUE area.
...
Hi there!
I have a CI Model set up with this function and ActiveRecord:
function get_open_competitions()
{
$this->db->select('*, TO_DAYS(closingdate) - TO_DAYS(CURDATE()) AS days')
->from('challenges')
->where('closingdate >','CURDATE()')
->order...
I know the best way would be not to have any sql inside other sql, specially a complicated one, and would be better to use the analysis after the query, but because the way the system is build I would preffer to do it only on one query
Here is the query in question ("is a really cool query")
SELECT DISTINCT
o.orders_id,
o.faltantes...
Hi
I'm making a forum for skills.
I want to print a previous and/or next link on the thread page. So if theres a thread with a larger and/or lesser number than current, print it in lionk. And also i wanna limited only threads from the same forum as the thread im viewing is located in.
Basically likes this forum:
http://forum.tibia.co...
When I execute this query
SELECT * FROM login_table
WHERE username = 'sam'
AND pass = AES_ENCRYPT('passabc', 'mystring')
I keep on getting this error.
#1267 - Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='
Thanks in advance for any help
...
I'm looking for a way to track the number of visits to a page, without counting duplicates (like someone hitting refresh several times) and I'd like to figure out the best way to do it without keeping track of every single IP address to view the page. Perhaps a cookie? Any other suggestions?
...
I am designing the database for a shopping cart and I am having trouble deciding which way to approach this problem.
There are three tiers that can items can be restricted to:
1) Local Delivery Only
2) Shipping Available
a) Country
b) State
c) Region
I am thinking to go with a structure like this:
product_shipping_res...
I'm make a little game in php with mysql. Now I have a problem with one of the sql query's I created. The idea is that the query checks if the user has enough materials.
I have a query that if I use it like this it works:
SELECT
(
SELECT COUNT(*)
FROM building_requirements
WHERE building_id = '1'
) as building_requirements_count...
I have a "Jump To"-select box on my forum.
I want the forum that the thread I'm currently viewing to be SELECTED in the selectmenu.
I tried this:
$threadinfo = mysql_query("SELECT * FROM threads WHERE id = $threadid");
$thread = mysql_fetch_assoc($threadinfo);
$forums = mysql_query("SELECT * FROM forums ORDER BY name ASC");
while($f...
Hi,
I've table with data like
ticketid | comments
----------------------
1234 | >
> Ticket ID:TT19027
>
> Ticket Title:report debug
>
>
4567 |>
> Ticket ID:TT19028
>
> Ticket Title:report debug
>
>
I'm looking for a function or query that will return
ticketid | ticket_no_part_of_comments
1234 | TT19027
4567 ...
Hi,
Soon I'll be working on catalog(php+mysql) that will have multilang content support. And now I'm considering the best approach to design the database structure. At the moment I see 3 ways for multilang handling:
1) Having separate tables for each language specific data, i.e. schematicly it'll look like this:
There will be one tab...
I installed the lampp sever on my local in linux OS,
but its giving error while opening phpmyadmin.
#2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)
...
i have this code
var myChart = new FusionCharts("../themes/clean/charts/hbullet.swf", "myChartId", "400", "75", "0", "0");
myChart.setDataXML("<chart lowerLimit='0' upperLimit='100' caption='Revenue' subcaption='US $ (1,000s)' numberPrefix='$' numberSuffix='K' showValue='1'><colorRange><color minValue='0' maxValue='50' color='A6A...
i have column a ,column b in emp table. i like to retrieve values from that column find the difference between them. if i get 0 as difference i will return true else i will return false using functions.i am new to database so only i don't know how to do this.i like to know how to store the retrieved values from table to variable. i dont ...