Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Create A Query In Order To Dynamicly Popular A Listbox


I am trying to create a query in order to dynamicly popular a listbox however I am trying to fill the listbox with years such as 2007 etc based on if they are stored in the data base. The problem is that two tables have to be checked that have no relation to eachother but this caues the problem of duplication so if both tables have 2007 it will appear in the list more than once. Code:




View Complete Forum Thread with Replies

Related Forum Messages:
Breaking Up The Query String Dynamicly?
using $Get_string = $_SERVER['QUERY_STRING']; to receive a query string such as
month=may&$day=15&year=2006

so that $Get_string = "month=may&$day=15&year=2006"

can I separate the values and turn them into variables? (like a normally would with a url get)

$month = "may"
$day= "15" etc

it would be great to just do $_GET on the url but I'm sending the string as a variable to another script... so i can't just go the easy route.

View Replies !
Create Listbox Depending On Variable
I currently have a variable called $NumPlayers which contains a number between 4 and 8;

depending on this value; i would like to create this amount of listboxes on my page. For example if the value of $NumPlayers is 6;

I would like 6 listboxes to be displayed on the page with names such as "Lstbox1" "Lstbox2".

I'm a bit clueless where to start; and was hoping someone could point me in the right direction.

View Replies !
How To Use Selected Data In The Listbox For My Query..
I have a multiple select listbox and I pass the data using array in php. How can I use these records to my query, or in one select statement. For an example:

I have a listbox of item codes; the user selects an item code/s to view it's inventory. The selected itemcodes will be pass on php using array and these records will be used as a query or search items on my database.

View Replies !
How Can I Populate A Listbox With The Result Of Mysql Query?
I would like to populate a listbox with the result of a mySQL Query.

View Replies !
Listbox Contents Dependant On Selection In Previous Listbox
I need to create a form so that when an option is selected in listbox1, the contents of listbox2 change depending on what option has been selected.

I'm afraid I don't know where to begin with this one, I can create the listboxes so they populate dynamically by data from a database - but thats it!

View Replies !
Use Function To Create My Own Order For The Array.
I am having a small problem with array.

I have an array which may look like this: array(6,"*","-",7);

when I sort these it looks like * - 6 7

What I am trying to do is sort it so that it sorts the - as the first item

So I am trying to end up with an array that looks like this: - * 6 7 (with the * and - swapped around)

none of the sort functions seem to be able to do this.

Perhaps the usort would but I am not sure I quite understand how I would use that function to create my own order for the array.

View Replies !
Multiple Select From Listbox And Execute A Sql Query Select Statement
Supposing i have a html form with 2 listbox and i name it status and resolution.

So it goes <select name='status[]'>... <select name='resolution[]'>

Then i have a another php page.
$status = $_POST['status'];
$resolution = $_POST['resolution'];

Now my question is, how do i do the sql query statement?

mysql_query("SELECT * from bugs where status=$status and resolution=$resolution");

The problem is, i select 3 options form the status listbox eg. new, closed, duplicate. And from the resolution, i chose fixed, invalid.

View Replies !
What Function Is Necessary In Order To Create The Array Of Images?
i am trying to start a photography business, and what i want to accomplish is to be able to dynamically create a gallery. the script will simply look in the folder i specify, display 20 photos per page, and allow the user to click each photo to enlarge it.
 
what i want to know is what function is necessary in order to create the array of images?

any other information/snippets which pertain to my goal would be appreciated. i've been searching the forum but have yet to find a similar post in relation to what i am trying to obtain.

View Replies !
Order A Query
I have an easy question (I hope). I am trying to order a query, the field to order will be "sub" (which is an int) but I only want to put sub=0 up front, and all the rest behind but not in numeric order.

right now, I have:

ORDER BY sub, name

so it sorts by sub, and in the event of a tie, it sorts by name. I would like to have all the sub=0 first sorted by name, then all the sub>0 after, sorted by name.

Can I do this in ORDER BY or do I need a script?

View Replies !
Order BY Query
I have numerous tables that are searched by the following query:

$query = "SELECT date,meet,fname,sname,event,perf,mid,perf2 FROM out2006 WHERE fname LIKE '" . $fn. "%' AND sname ='$sn' UNION ALL SELECT date,meet,fname,sname,event,perf,mid,perf2 FROM indoor200506 WHERE fname LIKE '" . $fn. "%' AND sname ='$sn' UNION ALL SELECT date,meet,fname,sname,event,perf,mid,perf2 FROM out2005 WHERE fname LIKE '" . $fn. "%' AND sname ='$sn' UNION ALL SELECT date,meet,fname,sname,event,perf,mid,perf2 FROM indoor200405 WHERE fname LIKE '" . $fn. "%' AND sname ='$sn' UNION ALL SELECT date,meet,fname,sname,event,perf,mid,perf2 FROM out4 WHERE fname LIKE '" . $fn. "%' AND sname ='$sn' UNION ALL SELECT date,meet,fname,sname,event,perf,mid,perf2 FROM indoor3 WHERE fname LIKE '" . $fn. "%' AND sname ='$sn' ORDER BY 'event'";

I have tried to then run an ORDER BY query, byt fails. The above produces a list of athletes performances, I just want them ordered by "event " and "perf," "mid," "perf2."

View Replies !
My Query Dnt Add The Order
i cant add the customer order to the database. ive checked using echo $_post['sname']; where my error message is displayed, and it has stored the name, but it dnt add. Code:

View Replies !
Query Order
I am doing a query in table thread Quote:

WHERE t.threadid in (44371,44373,44374,44372,44375).

View Replies !
Create A Simple Web Form In Order To Allow Visitors To Send Me Their Comments Via Email.
I want to create a simple web form in order to allow visitors to send me their comments via email. I created this code:

$to = "mybox@mydomain.com";
$subject = "Comments from the web";
$body = "Comments:";
$body = $body . "----------------------- ";
$body = $body . $email . "";
$body = $body . "-----------------------";
$body = $body . $name . "";
$body = $body . "----------------------- ";
$body = $body . $text . "";
$headers = "From: $email";
mail($to,$subject,$body,$headers);

'$email' is the email address of the visitor, '$name' is their name, and '$text' is the contents of the comments. But I found out that some spammers used this form to send spam. I didn't make any filter of the contents, and I was suggested they were using script injection within the form. Do you know any more-secure web form for sending emails?

View Replies !
Query Order Problem
I've got a table in my dB which looks like this:

id | name | project | type | catagory | keywords | description | image | live | timestamp

and using this code: PHP Code:

$query_Recordset1 = "SELECT * FROM datacore GROUP BY project ORDER BY `timestamp` DESC";

I'm getting a weird order. The idea here, is to get back the most recent file for each project based on the timestamp. I've looked over the numbers and my results bring back 2 projects. I only have two projects, so that's fine, but the row that's coming back from each project isn't based on the timestamps within each project.

I think this is because it's grouping the results first, then it's ordering the results by the timestamps. What I want it to do is order by timestamps, then get the newest image for each project.

View Replies !
Mysql Query ORDER BY
my code has been working fine but for some reason today it stoped.

$search = mysql_query("SELECT `id` , `site_title` FROM `sites` WHERE `accepted`='1' ORDER BY `site_in` DESC LIMIT $lima, $limb");
while (mysql_fetch_row($displaySearch)){
// data,,,

But it isnt displaying this correctly. :s its displaying like 3 then 25.

View Replies !
Order Query Results Alphabetically
I need to order query results alphabetically BUT I also need to start showing them starting from one of these values. eg. if my records are: yellow, brown, red, green, white. I need to show "red" records first and then other ones in alphabetic order:

red
brown
green
white

Is it possible to do this using a query only?

View Replies !
Query - Create The Mysql Query To Get All Fields
I've a table "article".
Any article is of a type in table "type1" or "type2"
Each type may be of a model in table "model1" or "model2".
Each model can be on a certain make, also in 2 tables, "make1" and "make2".

they are a few possibilities.
"article" can be of "type1" or "type2"
"type1" can be of "model1" only - "type2" can be of "model1" or "model2"
"model1" can be of "make1" only - "model2" can be of "make1" or "make2"

"article" has "type.id" field (char10). If it start with "my" then it's a
"type2", otherwise is a "type1"
"type1" has only "model1.id" field. "type2" has "model1" and "model2"
fields. If one is filled, the other isn't
"model1" has only "make1.id" field. "model2" has "make1.id" and "make2.id"
fields. If one is filled, the other isn't

so here are the possibilities:
article -> type1 -> model1 -> make1
article -> type2 -> model1 -> make1
article -> type2 -> model2 -> make1
article -> type2 -> model2 -> make2

Now, I must create the mysql query to get all fields given the "article.id".
Is it possible ?
How ?
will this work ? in pseudo-code

article left join type1 articleid = type1id
inner join model1 type1id = model1id //inner because if type1, the model is
1
inner join make1 model1id = make1id //inner because if model1, the make is 1
left join type2 articleid = type2id
left join model1 type2id = model1id
left join model2 type2id = model2id
left join make1 model2id = make1id
left join make2 model2id = make2id

View Replies !
MySQL Query To Order By User's Posts Instead Of Name
I have a script for users who post articles. The script shows the list of users ordered by name but I would like to order it by number of articles written.

I was hoping if somebody can help me figure out the change in the code to do this. I thought I could just change the ORDER BY argument in the query but the coder wrote it differently because the posts are in a different table, so I am not sure how to do it.
Here is the code:

View Replies !
Checkboxes Dynamicly Generated
I have a form with 3 checkboxes wich have all the same name:

<input type=checkbox name=test value=val1>
<input type=checkbox name=test value=val2>
<input type=checkbox name=test value=val3>

now on the target page i need all values that are checked, so if they are all 3 ckecked i need to get val1, val2 and val3 on the target page. With ASP you get the varaible test = val1;val2;val3 (the values are all put in one variable, separated with a ";"

But when i use PhP i only get the last value in this case "val3". What do i need to do to get all values? I have named them all the same because those checkboxes are dynamicly generated. I dont know how many there will be.

View Replies !
Changing Upload_tmp_dir Dynamicly
Is there a way to change the upload_tmp_dir directive dynamicly in the script.
As i know this is a system directive and is possible to be changed only manualy from php.ini.

View Replies !
Populating A List Dynamicly
Is there an easy way to populate a list dynamicly? It stinks javascript here, but I don't know how to do it with that either. I have one list A that contains enteries with ID's as values.

List B should then fill with information from a database according to wich ID is choosen in list A. Since alot of otherthings is entered on the page to I would like to nopt have to deal with sending all the data and loading the same page again.

Is there a way in PHP to link to the same page and have all the filled textfields stay as they were? Or do I have to use post?

I have the thought of loading all the data from the database and having it in an array or something and having a javascript picking and writing the choosen ones to the list. But that would be alot of excess data so getting it "live" from the db would be better.

View Replies !
Recreate The Query For Each Day In Order To Show The Result In A Table
I would like to get a count for every element filled on that day but however i am unsure how to make this query to the mysql db. for example every thing filed on a monday or for each given day of the week may be better. table field is called date and is in datetime format Y-d-m H:i:s

how would i complete this query to get it to look for each even if i had to recreate the query for each day in order to show the result in a table. PHP Version 4.3.11 being used
PHP Code:

Select count (something) as total from database where ?

View Replies !
Displaying Dynamicly Created Images
I'm working on the registration page of my website, and am building in a system where the user has to read something out of a dynamically created image. I can create the image just fine, but how do I get it to display in a web page? Code:

View Replies !
Dynamicly Created Page, With Refereing Url Shown
I have loads of domain names but none have any hosting space associated. They are however all entered into my DNS, so when any of them are visited, the visitor ends up at the (unused) home page of my dns server.

I would like to put a php (or perl, or whatever else is suitable) page here so the visitor is shown a more freindly page.

So, for example, a "Welcome to domain.com, this page is under construction / for sale" type page is what I would want. So all I would need to do for each domain to have it's own page would be to enter the domains in to my DNS and the rest would be automatic.

View Replies !
Popular IRC Channels
could anyone tell me some of the most popular PHP IRC channels and the servers they are on?

View Replies !
Most Popular Page
I am updating a column in some tables which holds a value about how many times a page was requested so I can monitor which pages are most popular it works fine, but is very prone to cheating, because I dont know of a good way to limit this per user/ visitor now, it will only update for logged in users, regardless of how many times they viewed the page, so if someone presses F5 100 times, it will increase with 100, Id like to be able to limit the number of times the field is updated to once per session, but Id like the same for not logged in users, which is where I see problems.

View Replies !
Most Popular Record In A Table?
I have a table with lots of entries, eg:

Bob
Fred
Bob
Graham
Bob
Harold
Bob
Frank
William
Fred
Bob

How can I find out which is the most popular name (ie which one appears the most often - in this example 'Bob')?

View Replies !
Counting Most Popular Column
I can't seem to find a way to do this. I need to fetch the most popular entries in a table column, limited to 9 max. How do I do that?

View Replies !
Popular And Easily Implemented Framework
We are trying to implement PHP framework in our New PHP Project.
Can you please give suggestion about this? Which are the most popular
and easily implemented framework in PHP? Where can I learn more about
those frameworks?

View Replies !
MySQL Viewing Popular Tables
I run a website with two dedicated servers one completely for the database, and the other for everything else. The database server has a massive CPU usage and I want to see which tables in particular are using up the CPU. I can only run queries to see the number of rows is there any way of seeing how much data has been transfered from the table etc? I have root server access so I can run linux commands also.

View Replies !
Add Some Of The Popular Key Phrases To A Preg_match And If It Exists
I installed a PHP helpdesk for people to get help with our services. I created a email system that will pipe to the helpdesk.

Now the helpdesk is getting spammed. I found the email parse script and I'm trying to add some of the popular key phrases to a preg_match and if it exists, exit out, and not create the message on the system. Code:

View Replies !
What's The Most Popular Templating Engines/modules Around That People Are Using?
I'm relatively new to PHP develolpment, but what's the most popular
templating engines/modules around that people are using? Whats the most
popular?

View Replies !
10 Speed Test For Popular Databases By Justin Silverton
Written by : Justin Silverton
Source : http://blinduser.blogspot.com/

I came across the following 10 benchmark tests covering:

SQLite version 3.3.3
SQLite version 3.3.3
SQLite version 2.8.17
SQLite version 2.8.17
PostgreSQL version 8.1.2
MySQL version 5.0.18
FirebirdSQL version 1.5.2

About the hardware/database settings used:

All databases were installed with default settings.
Tests were run on 1.6GHz Sempron with 1GB of ram and 7200rpm SATA disk
running Windows 2000 + SP4 with all updates applied.

Test 1: 1000 INSERTs

CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100));INSERT INTO t1
VALUES(1,13153,'thirteen thousand one hundred fifty three');INSERT
INTO t1 VALUES(2,75560,'seventy five thousand five hundred sixty');...
995 lines omittedINSERT INTO t1 VALUES(998,66289,'sixty six thousand
two hundred eighty nine');INSERT INTO t1 VALUES(999,24322,'twenty four
thousand three hundred twenty two');INSERT INTO t1
VALUES(1000,94142,'ninety four thousand one hundred forty two');

SQLite 3.3.3 (sync):
3.823
SQLite 3.3.3 (nosync):
1.668
SQLite 2.8.17 (sync):
4.245
SQLite 2.8.17 (nosync):
1.743
PostgreSQL 8.1.2:
4.922
MySQL 5.0.18 (sync):
2.647
MySQL 5.0.18 (nosync):
0.329
FirebirdSQL 1.5.2:
0.320

Test 2: 25000 INSERTs in a transaction

BEGIN;CREATE TABLE t2(a INTEGER, b INTEGER, c VARCHAR(100));INSERT
INTO t2 VALUES(1,298361,'two hundred ninety eight thousand three
hundred sixty one');... 24997 lines omittedINSERT INTO t2
VALUES(24999,447847,'four hundred forty seven thousand eight hundred
forty seven');INSERT INTO t2 VALUES(25000,473330,'four hundred seventy
three thousand three hundred thirty');COMMIT;

SQLite 3.3.3 (sync):
0.764
SQLite 3.3.3 (nosync):
0.748
SQLite 2.8.17 (sync):
0.698
SQLite 2.8.17 (nosync):
0.663
PostgreSQL 8.1.2:
16.454
MySQL 5.0.18 (sync):
7.833
MySQL 5.0.18 (nosync):
7.038
FirebirdSQL 1.5.2:
4.280

Test 3: 25000 INSERTs into an indexed table

BEGIN;CREATE TABLE t3(a INTEGER, b INTEGER, c VARCHAR(100));CREATE
INDEX i3 ON t3(c);... 24998 lines omittedINSERT INTO t3
VALUES(24999,442549,'four hundred forty two thousand five hundred
forty nine');INSERT INTO t3 VALUES(25000,423958,'four hundred twenty
three thousand nine hundred fifty eight');COMMIT;

SQLite 3.3.3 (sync):
1.778
SQLite 3.3.3 (nosync):
1.832
SQLite 2.8.17 (sync):
1.526
SQLite 2.8.17 (nosync):
1.364
PostgreSQL 8.1.2:
19.236
MySQL 5.0.18 (sync):
11.524
MySQL 5.0.18 (nosync):
12.427
FirebirdSQL 1.5.2:
6.351

Test 4: 100 SELECTs without an index

SELECT count(*), avg(b) FROM t2 WHERE b>=0 AND b<1000;select>=100 AND
b<1100;select>=200 AND b<1200;...>=9700 AND b<10700;select>=9800 AND
b<10800;select>=9900 AND b<10900;>Test 5: 100 SELECTs on a string
comparison

SELECT count(*), avg(b) FROM t2 WHERE c LIKE '%one%'SELECT count(*),
avg(b) FROM t2 WHERE c LIKE '%two%'SELECT count(*), avg(b) FROM t2
WHERE c LIKE '%three%'... 94 lines omittedSELECT count(*), avg(b)
FROM t2 WHERE c LIKE '%ninety eight%'SELECT count(*), avg(b) FROM t2
WHERE c LIKE '%ninety nine%'SELECT count(*), avg(b) FROM t2 WHERE c
LIKE '%one hundred%'

SQLite 3.3.3 (sync):
4.853
SQLite 3.3.3 (nosync):
4.868
SQLite 2.8.17 (sync):
4.511
SQLite 2.8.17 (nosync):
4.500
PostgreSQL 8.1.2:
6.565
MySQL 5.0.18 (sync):
3.424
MySQL 5.0.18 (nosync):
2.090
FirebirdSQL 1.5.2:
5.803

Test 6: INNER JOIN without an index

SELECT t1.a FROM t1 INNER JOIN t2 ON t1.b=t2.b;
SQLite 3.3.3 (sync):
14.473
SQLite 3.3.3 (nosync):
14.445
SQLite 2.8.17 (sync):
47.776
SQLite 2.8.17 (nosync):
47.750
PostgreSQL 8.1.2:
0.176
MySQL 5.0.18 (sync):
3.421
MySQL 5.0.18 (nosync):
3.443
FirebirdSQL 1.5.2:
0.141

Test 7: Creating an index

CREATE INDEX i2a ON t2(a);CREATE INDEX i2b ON t2(b);
SQLite 3.3.3 (sync):
0.552
SQLite 3.3.3 (nosync):
0.526
SQLite 2.8.17 (sync):
0.650
SQLite 2.8.17 (nosync):
0.605
PostgreSQL 8.1.2:
0.276
MySQL 5.0.18 (sync):
1.159
MySQL 5.0.18 (nosync):
0.275
FirebirdSQL 1.5.2:
0.264

Test 8: 5000 SELECTs with an index

SELECT count(*), avg(b) FROM t2 WHERE b>=0 AND b<100;select>=100 AND
b<200;select>=200 AND b<300;...>=499700 AND b<499800;select>=499800
AND b<499900;select>=499900 AND b<500000;>Test 9: 1000 UPDATEs without
an index

BEGIN;UPDATE t1 SET b=b*2 WHERE a>=0 AND a<10;update b="b*2">=10 AND
a<20;... b="b*2">=9980 AND a<9990;update b="b*2">=9990 AND
a<10000;commit;>Test 10: 25000 UPDATEs with an index

BEGIN;UPDATE t2 SET b=271822 WHERE a=1;UPDATE t2 SET b=28304 WHERE
a=2;... 24996 lines omittedUPDATE t2 SET b=442549 WHERE a=24999;UPDATE
t2 SET b=423958 WHERE a=25000;COMMIT;

SQLite 3.3.3 (sync):
1.883
SQLite 3.3.3 (nosync):
1.894
SQLite 2.8.17 (sync):
1.994
SQLite 2.8.17 (nosync):
1.973
PostgreSQL 8.1.2:
23.933
MySQL 5.0.18 (sync):
16.348
MySQL 5.0.18 (nosync):
17.383
FirebirdSQL 1.5.2:
15.542

Test 9: 1000 UPDATEs without an index

BEGIN;UPDATE t1 SET b=b*2 WHERE a>=0 AND a<10;update b="b*2">=10 AND
a<20;... b="b*2">=9980 AND a<9990;update b="b*2">=9990 AND
a<10000;commit;>Test 10: 25000 UPDATEs with an index

BEGIN;UPDATE t2 SET b=271822 WHERE a=1;UPDATE t2 SET b=28304 WHERE
a=2;... 24996 lines omittedUPDATE t2 SET b=442549 WHERE a=24999;UPDATE
t2 SET b=423958 WHERE a=25000;COMMIT;

SQLite 3.3.3 (sync):
1.883
SQLite 3.3.3 (nosync):
1.894
SQLite 2.8.17 (sync):
1.994
SQLite 2.8.17 (nosync):
1.973
PostgreSQL 8.1.2:
23.933
MySQL 5.0.18 (sync):
16.348
MySQL 5.0.18 (nosync):
17.383
FirebirdSQL 1.5.2:
15.542

If you want to see some more information on the above and 10 more
tests, you can go Here:

View Replies !
How To - Create Dynamic Query
Can someone point me in the right direction on how to go about creating dynamic queries.

What I would like to do is pass variables from a form or some other method and create a select statement to query mySQL.

so instead of hardcoding select value 1,value2 from myTable;
I would like to be able to dynamically create a query so it could have either a few values to pass or a whole bunch.

View Replies !
Create A Paging To Query
I need to create a paging to my query, i want my results to be display every 5, if it is the first 5 it will only have the "next" button if it is the last page of results it will show the "back" button and anywhere in between it will show both buttons...

View Replies !
Create Database Query
Here is the code -

$query="CREATE TABLE 'hornpv886'.'clientdetails' (
'id' INTEGER UNSIGNED NOT NULL DEFAULT NULL AUTO_INCREMENT,
'Date_Required_From' TEXT NOT NULL,
'Date_Required_To' TEXT NOT NULL,
'Firstname' TEXT NOT NULL,
'Surname' TEXT NOT NULL,
'Number_of_People' TEXT NOT NULL,
'Names_of_People' TEXT NOT NULL,
'Address_Line_1' TEXT NOT NULL,
'Address_Line_2' TEXT NOT NULL,
'Town_City' TEXT NOT NULL,
'County' TEXT NOT NULL,
'Postcode' TEXT NOT NULL,
'Country' TEXT NOT NULL,
'Phone_Number' TEXT NOT NULL,
'Mobile_Number' TEXT NOT NULL,
'Email_Address' TEXT NOT NULL,
'Date_Required_From' TEXT NOT NULL,
PRIMARY KEY('id'),
UNIQUE 'id_2'('id') )";

View Replies !
Create A Table From A Mysql Query
How would you create a table from a mysql query, but limit the amount of values on each row.

View Replies !
Create A Query That Will Return All Of The DB's TestIDs,
My site's users take tests, and their responses are recorded in a "response" table. Here are the relevant tables:

User
userID

Test
testID

Response
responseID
testID
userID

I'm trying to create a query that will return all of the DB's testIDs, and indicate if a given userID has taken them. For tests not taken by a user, NULLs will be returned.

Let's say that the DB contains six tests, numbered 1-6. User #4 has taken every test, except for numbers 4 and 5, so there would be responseIDs linking userID #4 to those testIDs.

View Replies !
Create A Mysql Query Out Of An Array.
I am trying to create a Mysql query out of an array. Here is my code.

$lookup = mens jackets;
$lookup = explode(' ',$lookup);
$count=count($lookup);

for($i=1; $count >= $i; $i++){
$query =("select * from stuff WHERE description LIKE ('$lookup[0]')
$query .= AND ('$lookup[$i]')
$query .= ");}

here are my results I am getting; Code:

View Replies !
UPDATE Query - Create A New Record
Here's my dilemma. Some pitchers (all of whom, obviously, have stats in the pitchers stats table) also have hitting stats in the hitter_stats table, but some dont. So, i need something like this.

If the pitchers player_id exists in the hitterstats table for a certain year, then insert the stats into that yearly record. If there is no record for that player_id, then create a new record for that pitchers players_id. im having trouble coming up with this one,

View Replies !
Create A Good MySQL Query
i have mysql table `orders` with field `status` = enum('inactive', 'active', 'expired', 'suspended');

I need to display results sorting by `status`.

The simpliest way would be to make 4 queries with selecting different status value. But maybe i could get the same result with only one mysql query?

View Replies !
MYSQL Query: Create Table AND Row
I am trying to create a table and a row at the same time. Right now my create table code works, I just want to know how I should add the row? Code:

View Replies !
$query = "SELECT * FROM File ORDER BY Image_id DESC"; // How Do I Get The Post ID?
I also made a auth script that deletes submitted posts. When i click NO on publishing the submitted post it says unlink cannot find the file. I know why this is saying this but don’t know how to get around the problem? Code:

View Replies !
Possible To Create A Variable From The Results Of A Mysql Query?
I need to perform a mysql query,Take the results and create a loop for each item that returns, and then create a variable that will pull the complete results from the query to include into a template. here is the code I am woring with PHP Code:

View Replies !
Connect To Two Separate Databases, And Create A Query ..
Can someone show me how I might be able to connect to two separate
databases, and create a query from the two? I understand in Oracle this is
referred to as "database links" but is there a more general way to do this
(i.e. will work with, say, mysql and other DBs?) I want to comapre a field
that is present in two separate files on two seperat databases.

View Replies !
Query Mysql, Return Highest Value Then Create Value +1
I have a product input form I created (with php freaks help) for my website which I input general information and specs on our products. What I'd like to do now is when that form loads, it searches a seperate table and looks for the highest "ID" number.

It returns the number, adds 1 to it and displays the number somewhere on the input form for reference + error checking. When the form is submitted it takes that form and creates a record pushing that number in the correct field.

View Replies !
To Create A Query String From Selected Checkboxes
I've a set of checkboxes in my form like:

<input type="checkbox" name="checked[]" value="1">
<input type="checkbox" name="checked[]" value="2">
<input type="checkbox" name="checked[]" value="3">

I want to make a query string "update ..... where id in (&#391;',&#392;',&#393;')"

How can I make the highlighted part from the selected values? I've done like this Code:

View Replies !
Create A SQL Query To Count The Number Of Votes
I have created a voting system in PHP in which visitors can vote for any of 1000 companies. I wish to create a SQL query to count the number of votes for each company and list the 20 highest and state the number of votes they received. Please can someone give me a little guidance on how I can do this?

View Replies !
Create A Query That Will Insert Each Size Into 1 Record
Seeking some help on a site i'm working on. Our company acquired a software for order processing we do. I am in the midst of trying to format it somewhat and i'm coming across a situation i'm not familiar with. In this code, there is a loop statement that adds the quantity of SM, MD, LG, 1X, 2X and 3x and displays a grand total. I am needing to create a query that will insert each size into 1 record, sorta like this:

Record1: Qty, BaseID, CustomText, Size,Price, Extended Price

THis will need to be done with each size that the user has added to the cart.I am not displaying any info now, as i am unser what is needed but if someone can point me in the right direction, it will be greatly appreciated. I will post whatever code is needed.



View Replies !
How To Create A Multi D. Array From Single Query
I am trying to build a multidimensional array with a single query. Code:

View Replies !
How Do I Create A Link That Runs A MySql Query When Pressed!!
I Want To Create A Link, And When You Press That Link It Runs A MySql Query.

View Replies !
Create An Array Indexed By One Of The Values Returned From Query.
I need to create an array indexed by one of the values returned from query.

$query = "SELECT ID, Name, Number FROM Table";

I want to store the result in an array indexed by "ID" so I can refer to it as $arr['ID'].

I want to be able to get a selectedIndex.value of a dropdown and use it as index to this array to get other values, such as Name and Number.

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved