User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
DaniWeb is a massive community of 403,080 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,105 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Showing results 1 to 40 of 44
Search took 0.01 seconds.
Posts Made By: MCP
Forum: MS SQL Jan 16th, 2007
Replies: 2
Views: 5,496
Posted By MCP
Re: Howto | mssql seach and replace?

Also, look at the SUBSTITUTE function
Forum: PHP Jan 14th, 2007
Replies: 2
Views: 1,364
Posted By MCP
Re: Sorting Database Results

How about something like:

select count(*)
from students
where total_raised > (select total_raised from students where uid=$uid)

This should tell you how many students have total_raised greater...
Forum: MS SQL Jan 12th, 2007
Replies: 2
Views: 3,204
Posted By MCP
Re: SQL 2005 upgrade questions

1. You won't lose anything -- you can import the old into the new as legacy DTS packages. SQL Server 2005 comes with SSIS, which is a little more complex than DTS, but definitely better!

3. No, it...
Forum: PHP Jan 11th, 2007
Replies: 15
Views: 7,499
Posted By MCP
Re: Can a text link pass php variables?

While a form using the post method is less obvious then the ?id=xyz in the url, they're both just as hackable. If you want to verify (assuming you're running windows), check out Microsoft Fiddler,...
Forum: PHP Jan 10th, 2007
Replies: 15
Views: 7,499
Posted By MCP
Re: Can a text link pass php variables?

No problem! FYI, you can pass multiple variables by doing:

whatever.php?id=5&variable2=whatever&xyz=aaa
Forum: MS SQL Jan 9th, 2007
Replies: 1
Views: 1,174
Posted By MCP
Re: Data Replication

I'm not too familiar with SQL Server's replication feature.

For your import/export however, what error messages did you get while trying to move data from dbaseB to dbaseC? If it's the same schema,...
Forum: MS SQL Jan 9th, 2007
Replies: 3
Views: 4,685
Posted By MCP
Re: Splitting Full name data to First, Last

I think you're better off avoiding cursors where possible! It's much slower than a straight up statement, such as:


select name,
substring(name,1,charindex(' ', actor_name)-1) FirstName,
...
Forum: PHP Jan 9th, 2007
Replies: 15
Views: 7,499
Posted By MCP
Re: Can a text link pass php variables?

Just build each link like:

<a href='editform.php?id=53'>John Doe</a>
Forum: PHP Jan 2nd, 2007
Replies: 2
Views: 2,784
Posted By MCP
Re: How to replace missing images with default image

Maybe use something in javascript along the lines of:

function validateImage(url){
var img = new Image();
img.src = url;
return img.height>0;
}
which should return true if the image exists...
Forum: MS SQL Dec 16th, 2006
Replies: 3
Views: 2,535
Posted By MCP
Re: How to write this sql statement?

have a look at the sp_executesql (or is it sp_execute -- can't remember). with this method, you build your string in SQL, then execute it with the SP above. BOL should have more info and examples
Forum: PHP Dec 12th, 2006
Replies: 7
Views: 1,237
Posted By MCP
Re: Coding help - Is this possible? I think it is.

Smarty (http://smarty.php.net) is a pretty good templating system that you can use as part of a flat file db system. You'll still need to store the editable data somewhere -- flat file or db -- and...
Forum: MS SQL Dec 9th, 2006
Replies: 3
Views: 2,462
Posted By MCP
Re: IDENTITY question

Valid theoretical question (I think it will error with overflow), but do you practically think you'll get there? bigint can go up to 9,223,372,036,854,775,807

That's pretty big... Just to try and...
Forum: MS SQL Dec 9th, 2006
Replies: 5
Views: 8,211
Posted By MCP
Re: Incorrect syntax near '='.

Are all the values in the column like 000000001? Because you could just do field+0 that would implicitly convert it... or cast(field as int) to explicitly do it. if you have mixed fields, then you...
Forum: MS SQL Dec 9th, 2006
Replies: 1
Views: 1,211
Posted By MCP
Re: Table query returning error -- help!

see DBCC CHECKTABLE in BOL for more info... be careful about the repair, as it could invalidate.. but it should fix the table even if some of the data might be lost. Good luck!
Forum: MS SQL Dec 6th, 2006
Replies: 5
Views: 8,211
Posted By MCP
Re: Incorrect syntax near '='.

CASE is used when you want to return different values based on different conditions, such as:

select case when priority=1 then 'Low' when priority=2 then 'Med' when priority=3 then 'High' end from...
Forum: MS SQL Dec 4th, 2006
Replies: 3
Views: 1,792
Posted By MCP
Re: Just for fun Lotto SQL

aah.. i keep on missing the "desc" in the order by, but that should be easy enough to figure out :)

select top 3 d1.num num1, d2.num num2
from data d1 inner join data d2 on (d1.date=d2.date) and...
Forum: MS SQL Dec 3rd, 2006
Replies: 3
Views: 1,792
Posted By MCP
Re: Just for fun Lotto SQL

actually, no need for the distinct count.. :

select top 3 d1.num num1, d2.num num2
from data d1 inner join data d2 on (d1.date=d2.date) and (d1.num<d2.num)
group by d1.num, d2.num
having...
Forum: MS SQL Dec 3rd, 2006
Replies: 3
Views: 1,792
Posted By MCP
Re: Just for fun Lotto SQL

My approach would be something like the following, assuming the second data structure. (It's untested)

select top 3 d1.num num1, d2.num num2
from data d1 inner join data d2 on (d1.date=d2.date) and...
Forum: PHP Dec 2nd, 2006
Replies: 2
Views: 36,423
Posted By MCP
Re: anti proxy

Here's one, although the latest version is not yet available
http://whitefyre.com/poxy/
Forum: PHP Nov 29th, 2006
Replies: 8
Views: 1,903
Posted By MCP
Re: Php & Xhtml

Well, I'm not at all familiar with XFORMS, but you can use (assuming you're under Windows) Microsoft Fiddler to examine the data transferred. You can pick up the headers that are normally sent from...
Forum: PHP Nov 26th, 2006
Replies: 1
Views: 1,039
Posted By MCP
Re: OO syntax in PHP 4?

The mysqli code is causing a fatal error (not sure that it's available in PHP 4.x), and stopping the rest of the script from executing. If you remove the "@" from in front of the line, you will see...
Forum: PHP Nov 25th, 2006
Replies: 2
Views: 907
Posted By MCP
Re: Seacrch text using php

What database software are you using? Some have full text search capabilities which are quite neat. You could search for "styles" or "styling", and it would match "Style", because they're related....
Forum: Database Design Nov 18th, 2006
Replies: 2
Views: 1,711
Posted By MCP
Re: Access Database file conversion

Do you really need to send all 30 000 records? Can you instead send only relevant parts and have a central consolidation process?

Also, zip works wonders with access mdb files. I customarily get it...
Forum: MySQL Nov 18th, 2006
Replies: 1
Views: 1,486
Posted By MCP
Re: MS Access v/s MS SQL Server 2000

This belongs in the MSSQL forum, but the corresponding datatype is the more powerful identity data type. I don't think it supports 'random' like access, but you can start from any number, and you can...
Forum: MS SQL Nov 18th, 2006
Replies: 1
Views: 1,622
Posted By MCP
Re: SQL slow in Domain Control

Is "SQL Active Directory" performing certificate verification against crl.microsoft.com? I had an issue with other components of SQL Server 2005 wanting to check revocation of certificate against...
Forum: MS SQL Nov 17th, 2006
Replies: 4
Views: 1,778
Posted By MCP
Re: Altering data when reading it from a database

Yup, that's correct, color is the "physical" name of the column.
Forum: MS SQL Nov 15th, 2006
Replies: 4
Views: 1,778
Posted By MCP
Re: Altering data when reading it from a database

Well, the bad way would be to do something like:

select case color when 0 then 'black' when 1 then 'white' when 2 then 'red' when 4 then 'blue' end as color from myTable

ideally, you would create a...
Forum: MS SQL Nov 15th, 2006
Replies: 1
Views: 6,015
Posted By MCP
Re: SQL trigger based on a true/false field value

I don't have my sql server readily available, but you could use the "create trigger" command, then use the logical tables "inserted" and "deleted" (which represent what is and what was, respectively)...
Forum: MS SQL Nov 13th, 2006
Replies: 2
Views: 2,976
Posted By MCP
Re: How to set permission to access a table on another database?

If the user running the query has rights to select the table in the other database, you will be able to. the syntax is something like:

select * from tableA join otherDB.dbowner.tableB on...
Forum: PHP Nov 4th, 2006
Replies: 5
Views: 1,233
Posted By MCP
Re: Rateing option using php

well, all you need to keep track of then is the sum and the number of ratings so that you when you get a new rating, you'd just do

UPDATE ratings SET sumRatings=sumRatings+{$newRating},...
Forum: PHP Oct 29th, 2006
Replies: 6
Views: 5,318
Posted By MCP
Re: Storing dynamic form values in Arrays for display & insert

yup, either way is probably fine -- whichever way works.. I can't see any benefits of doing it one way or the other
Forum: PHP Oct 28th, 2006
Replies: 6
Views: 5,318
Posted By MCP
Re: Storing dynamic form values in Arrays for display & insert

check out php's array_values function, which will essentially reindex the arrays
Forum: MySQL Oct 22nd, 2006
Replies: 2
Views: 6,175
Posted By MCP
Re: Syntax for adding two columns and sorting the results

try:

SELECT username, SUM(daily_units+rare_units) FROM table GROUP BY username ORDER BY SUM(daily_units+rare_units) desc

the sum function works by summing rows, not separate fields (i.e. it takes a...
Forum: MS SQL Oct 18th, 2006
Replies: 2
Views: 3,375
Posted By MCP
Re: Identity Column Problem in MS SQL Server

How are you moving the data? Through SQL statements? Through the EM Import Wizard?

Anyhow, the answer is enabling "identity insert" in your target table B. This option can only be active for one...
Forum: PHP Oct 18th, 2006
Replies: 3
Views: 1,270
Posted By MCP
Re: PHP errors on netscape enterprise server

Using Microsoft Fiddler (great program for some debugging and such!), I can see that your server is indeed doing what Puckdropper said .. no content type in the header.

Your server's return...
Forum: PHP Oct 15th, 2006
Replies: 6
Views: 1,682
Posted By MCP
Re: Help With a PHP RSS Parser

Well, what would you like to do when the feed is not available? I'm assuming that there is something else that the page will display... You're on the right track, basically (without knowing more...
Forum: PHP Oct 15th, 2006
Replies: 2
Views: 1,040
Posted By MCP
Re: Breaking strings

First Issue:
You can use:

list($month,$day,$year)=preg_split("/[,\s]/",$date); // (untested!)


or you can use the strtotime() function, which will convert it to a php datetime, and then do whatever...
Forum: PHP Oct 14th, 2006
Replies: 1
Views: 1,634
Posted By MCP
Re: Specify File type

I think the standard way is to check the file extension, or to check the mime type.

Of course, none of this guarantees that the uploaded file is a valid "audio" file. (What is an audio file for you?...
Forum: PHP Oct 14th, 2006
Replies: 6
Views: 1,656
Posted By MCP
Re: Remember ME option

...or in php use setcookie (http://ca3.php.net/manual/en/function.setcookie.php)

I'm assuming you're looking for the PHP code =)
Forum: Search Engine Optimization Oct 4th, 2006
Replies: 22
Views: 2,579
Posted By MCP
Re: PHP or ASP

tgreer, it depends on the URL, specifically the types and number of parameters present. stymiee is more correct in this regard. There's a video by Matt Cutts (see...
Showing results 1 to 40 of 44

 
All times are GMT -4. The time now is 1:06 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC