-
String comparisons
Date: 11/06/06
(MySQL Communtiy) Keywords: mysql, sql
I can’t find this in the mysql manual, I’m working on some filters and one of the things that we need to do is to have relative string comparisons.
When comparing strings is there any difference between > and >=? I tried both comparisons and they seemed to return the same result sets.
Thanks
Source: http://community.livejournal.com/mysql/105911.html
-
Remote DB backup
Date: 11/09/06
(MySQL Communtiy) Keywords: mysql, sql
Right now were doing backup's by hand because the last developer lied and said he had a working backup system. So instead of trying to figure out what he tried to do, my senior and I decided to start from scratch. Connection between the machines is handled with ssh pub/priv key and keychain so the local script doesn't have a problem connecting securely.
Untested but the plan is to have a cron script connect to the remote and run mysqldump. The backup DB account only has select privileges so one of the idea's was to put the password in my.cnf. IS there a better way then this?
Source: http://community.livejournal.com/mysql/106193.html
-
holy crap @ adodb
Date: 11/11/06
(PHP Community) Keywords: mysql, technology, sql
i'm just starting to learn the beauty of adodb. freaking hella saved lines of unnecessarily repeated code.
$sql = "SELECT * FROM $dbname.accounts WHERE id = '".$_COOKIE["account_id"]."'";
$result = $__db->Execute($sql);
$account_name = $result->fields["name"];
$account_prestige = $result->fields["prestige"];
$account_rank = $result->fields["rank"];
$account_kills = $result->fields["kills"];
replaced:
$account_query = "SELECT * FROM $dbname.accounts WHERE id = '".$_COOKIE["account_id"]."'";
$account_result = mysql_query($account_query, $connection) or die("Error getting account data: [" . mysql_error() . "]");
$account_row = mysql_fetch_array($account_result);
$account_name = $account_row["name"];
$account_prestige = $account_row["prestige"];
$account_rank = $account_row["rank"];
$account_kills = $account_row["kills"];
horray for coding technology! time to dance!
Source: http://community.livejournal.com/php/509542.html
-
Books, PHP, and OOP.
Date: 11/16/06
(PHP Community) Keywords: php, programming, mysql, database, sql, web
So I wanted an opinion on some books. I consider myself very well... dumb, in PHP. I can write simple backends to manage website content, upload files, screw with databases... but while loops, for statements, classes... they scare me.
In an effort to expand my knowledge of PHP I recently purchased two books:
Web Database Applications with PHP and MySQL (2nd Edition) by O'Reilly
Object-Oriented PHP: Concepts, Techniques, and Code by Peter Lavin
And the only purpose of this post is to see if any of you have opinions on these books, or suggestions for what I could do to begin obtaining a more robust handle on PHP programming. Because honestly... I'd rather code PHP than design another club flyer.
Source: http://community.livejournal.com/php/510766.html
-
Нужен толковый программист PHP
Date: 11/16/06
(PHP Development) Keywords: cms, php, mysql, html, xml, sql, java, web
Други, срочно требуется web-программист.
Санкт-Петербург.
От 1000 (по результатам собеседования).
Требования:
* PHP5 (понимание отличий между 4.x/5.0/5.1/5.2 будет большим плюсом)
* Понимание и умение применять ООП (знание "основных паттернов" будет
плюсом)
* Опыт работы с MySQL 5 или хорошее понимание реляционной модели
(если вас не пугают слова "триггер" и "хранимая процедура", то это
будет плюсом)
Желательно:
* JavaScript (JSON)
* Subversion
* XML-DOM, HTML-DOM
* Навыки работы в Unix-консоли
Если вы умеете что-то "сверх" и думаете что это может быть нам
интересно — упоминайте в резюме :)
Примеры кода в резюме — это полезно
О работе у нас:
В компании есть своя CMS. Основную часть времени программисты должны
будут дописывать её и заниматься оптимизацией процесса deploying'а
сайтов на ней. Подключением сайтов, в основном, занимаются
верстальщики и отнимать у них хлеб, соискателей никто не просит :)
Кроме того, в компании регулярно случаются заказы на кастомные
решения. При решении таких задач понадобиться иннициатива и знания
широкого профиля :)
Пишите: aleks на molinos точка ru или ICQ 95912480
Source: http://community.livejournal.com/php_dev/73825.html
-
Web Project
Date: 11/16/06
(WebDesign) Keywords: php, mysql, sql, java, web, hosting
Hello, everyone. I recently acquired a web project that I am, unfortunately, unable to do. It requires some PHP/MySQL and Javascript knowledge that is a little over my head. I was wondering if anyone here would like to either help me with this project, or take it on completely. The company is based in Dallas.
My website is www.thecablepro.com and we recently had a PHP upgrade by
our hosting company. Unfortunately some of the calculations for pricing
were upset by this and are not functional. There is also a number
showing up on some of the pages directly above the left upper corner of
the "cost per additional foot" box on the cables themselves. It seems
the way money amounts are displayed in the sale section is not correct
either. The amounts are showing up with only one numeral after the
decimal point.
If anyone is interested, please let me know by commenting. Thank you.
Note: I apologize in advance if this is not allowed.
Source: http://community.livejournal.com/webdesign/1187771.html
-
SQL 2005 Permissions
Date: 11/17/06
(Web Development) Keywords: database, sql, security
Ok, so here's the situation: Migrating from one server to another, and from MS SQL 2000 to MS SQL 2005. The approach I found recommended is dettaching the database on SQL 2000, moving it to the new server, and attaching on SQL 2005. This process worked, but here's the problem:
The database owner on the original machine is someusername. This information is embedded in the database, and when it's attached on the new server, still remains. When I try to go to database properties/permissions and remove the user, it removes it, but when I close the window and then reopen it, the user is there yet again. When I try to create a new user with the same name through Security/Logins and give it rights to the new database, it says that that username is already associated with the database and that it can't do this.
So are there any solutions to this specific problem or another way of moving from MS SQL 2000 to MS SQL 2005?
Thanks!
Source: http://community.livejournal.com/webdev/370919.html
-
problem with adodb
Date: 11/19/06
(PHP Community) Keywords: php, mysql, database, sql
Hi. I'm not really completely sure as to why this is happening. Here's my error message:
Fatal error: Call to a member function Execute() on a non-object in /opt/lampp/htdocs/medievalbattles/current/v8/httpdocs/include/functions.php on line 16
Here's the functions.php line (the whole function, really). Line 16 is $result = $__db->Execute($sql);
----------
// Does this email exist already?
function checkemail($email)
{
global $dbname;
$sql = "SELECT * FROM $dbname.accounts WHERE email = '$email'";
$result = $__db->Execute($sql);
if ($result->RecordCount >= 1)
{
$uid = $result->fields["id"];
return $uid;
}
else
return false;
}
----------
At the top of functions.php, I am including my config file (include("config.php");)
The contents of config.php are as follows:
----------
#####################
## Database variables
#####################
$dbhost = "localhost";
$dbuser = "root";
$dbpass = "";
$dbname = "mb_game";
/*
* ADOdb Lite v1.30
* http://adodblite.sourceforge.net/index.php
*/
require_once("/opt/lampp/htdocs/medievalbattles/current/v8/httpdocs/adodb/adodb.inc.php");
$__db = ADONewConnection($dbtype);
$__db->debug = false;
$__db->Connect($dbhost, $dbuser, $dbpass);
----------
Any idea as to why I'm getting this error?
(PHP v5.1.4 - MySQL v5.0.21)
Source: http://community.livejournal.com/php/512496.html
-
New to PEAR
Date: 11/22/06
(PHP Development) Keywords: php, mysql, software, sql, apache
Hi all
am Pretty new to using PEAR, facing some pbms here lately ,
I ve installed pear with the following setup : windows /apache 2/mysql /php5
now while execute the following code :
require_once('DB.php');
$db_host='localhost';
$db_database='somedb';
$db_username='someuser';
$db_password='somepwd';
$query='select * from employee';
$dsn = "mysql://$db_username:$db_password@@db_host/$db_database";
/$db = DB::connect($dsn);
?>
I am getting the following error :
"Warning: require_once(DB.php) [function.require-once]: failed to open stream: No such file or directory in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\pear.php on line 3
Fatal error: require_once() [function.require]: Failed opening required 'DB.php' (include_path='C:\PHP\pear') in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\pear.php on line 3"
please let me know how to fix this.thx alot.
Praveen.
Source: http://community.livejournal.com/php_dev/74476.html
-
mysql_affected_rows error
Date: 11/22/06
(PHP Community) Keywords: mysql, database, sql
ETA: Solved with the help of nickinuse.
Hi guys, I'm trying to make an email verification script.
1. User enters values to the contact form (done)
2. Contact form sends verification email to the entered user email (done)
3. User clicks on the link and verification process is complete (I'm stuck here)
// 1. open connection to MySQL (okay, done!)
$koneksi = mysql_connect($db_host, $db_user, $db_password) or die(mysql_error());
$db_select = mysql_select_db($db_name) or die(mysql_error());
// 2. query the database to see if the verification string match the ones in the database (this is okay, too!)
$query = "SELECT email_id FROM email_ver WHERE verify_string=$verify";
$result = mysql_query($query);
while ( $data = mysql_fetch_array($result) )
{ $drid = $data['email_id']; }
if ($drid!=$id)
{ $t="There are no such ID or request."; }
else {
// 3. query the database to update that email has been verified (this is where I'm stuck!)
$query = "UPDATE email_ver SET email_verify='y', verify_string='0' WHERE email_id=$id";
// specifically these next two lines!
$result = mysql_query($query) or die(mysql_error());
$num_rows = mysql_affected_rows($result);
// if the query work
if ($num_rows > 0) { echo "Yay! Your email is valid!"; }
}
I got this following error:
Warning: mysql_affected_rows(): supplied argument is not a valid MySQL-Link resource
Why is that happen? When the actual query is successfully done in the database (I've checked and re-checked). [Edit: It's because I'm feeding it with the wrong kind of resource. *LOL*]
Thanks!
Source: http://community.livejournal.com/php/513516.html
-
New to PEAR
Date: 11/22/06
(PHP Community) Keywords: php, mysql, software, sql, apache
Hi all
am Pretty new to using PEAR, facing some pbms here lately ,
I ve installed pear with the following setup : windows /apache 2/mysql /php5
now while execute the following code :
require_once('DB.php');
$db_host='localhost';
$db_database='somedb';
$db_username='someuser';
$db_password='somepwd';
$query='select * from employee';
$dsn = "mysql://$db_username:$db_password@@db_host/$db_database";
/$db = DB::connect($dsn);
?>
I am getting the following error :
"Warning: require_once(DB.php) [function.require-once]: failed to open stream: No such file or directory in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\pear.php on line 3
Fatal error: require_once() [function.require]: Failed opening required 'DB.php' (include_path='C:\PHP\pear') in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\pear.php on line 3"
please let me know how to fix this.thx alot.
Praveen.
Source: http://community.livejournal.com/php/513026.html
-
SQL Server 2005: A database on a different drive?
Date: 11/22/06
(SQL Server) Keywords: programming, database, sql
I think I know the answer to this, but I want to see if anyone has a different one...
I have a database (well, I have a spec, I'm not creating it until I know the answer to this question) I'd like to create on a flash drive. Is this possible? It seems to me that one has to create all databases from a given SQL Server instance in the same directory...
(Basically, I'd like to be able to access the database from four SQL Server instances on two different networks and one non-networked computer-- because those are the locations I'll be programming the front-end app.)
Source: http://community.livejournal.com/sqlserver/53898.html
-
Точность превыше всего
Date: 11/25/06
(Code WTF) Keywords: mysql, sql
//pi to 1000 decimals. If you want more accuracy, bring it out even further. I dont think that you
//would want to have it any more accurate than this anyways hehe.
$pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117
06798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493
03819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602
49141273724587006606315588174881520920962829254091715364367892590360011330530548820466521384146951
94151160943305727036575959195309218611738193261179310511854807446237996274956735188575272489122793
81830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748
18467669405132000568127145263560827785771342757789609173637178721468440901224953430146549585371050
79227968925892354201995611212902196086403441815981362977477130996051870721134999999837297804995105
97317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083
81420617177669147303598253490428755468731159562863882353787593751957781857780532171226806613001927
8766111959092164201989;
А дальше эта переменная идет в матоперации в SQL запрос для MySQL
Source: http://community.livejournal.com/code_wtf/59207.html
-
ADOdb Issue
Date: 12/01/06
(PHP Community) Keywords: php, sql
Fatal error: Call to a member function MoveNext() on a non-object in /opt/lampp/htdocs/medievalbattles/current/v8/httpdocs/game/skills.php on line 189
Line 89: $result2->MoveNext();
Any idea what's going on?
The while loop that it is part of:
$sql2 = "SELECT * FROM skills WHERE spec_id = '$tree_id' ORDER BY spec_points ASC";
$result2 = $__db->Execute($sql2);
while (!$result2->EOF)
{
Source: http://community.livejournal.com/php/516040.html
-
hi all
Date: 12/03/06
(SQL Server) Keywords: sql
Hello,
This is my first time posting here. I'm pretty new at SQL but I think that I am learning. :) Anyway, I have a sort of issue that I am hoping someone can clarify for me.
At my job, I am trying to fix up a query someone else made, forcing it to have all unique "PSourceIDs." Obviously, I can get 2 of the same number if I select distincts and then have two entries with different values anywhere in the record. So, here is what I was trying to do, eventhough it fails when I run it:
drop table #NewTest
select distinct psourceid into #NewTest
from #Test T
select * from #NewTest
insert into #NewTest (Priority, COSupplierCode, Aging, AgingToNow)
select Priority, COSupplierCode, Aging, AgingToNow
from #Test T
where (T.psourceid = #NewTest.psourceid)
select * from #NewTest
Firstly, can I do this with temp tables, and secondly, if so, then where did my logic fail?
Source: http://community.livejournal.com/sqlserver/54245.html
-
Potentially a dumb question...
Date: 12/03/06
(PHP Community) Keywords: database, sql
I feel like I should know how to do this but I am stumped and perhaps it's because I'm sick but anyway...
I have a form that will be used to search a database. The form has a total of 12 fields which can be filled out to perform the search.
My question is: Is there an easy way to include or exclude the fields in SQL query when accessing the database? That is, I only want to include the fields where something has been entered in the query string and am not sure how I would go about doing that.
Any help is greatly appreciated. Thank you in advance!
Source: http://community.livejournal.com/php/516175.html
-
Sharepoint server
Date: 12/04/06
(IT Professionals) Keywords: database, sql
I am trying to determine an easy way to backup a MS SharePoint Server. I am trying to do this on the cheap and have a MSSQL backup utility that is incorporated with my current backup solution.
Can I do backups of the MSSQL databases and that is all? And then when I have disaster, reinstall the OS, the Sharepoint, MSSQL and then restore the data in the database? Or will I need to use Stsadm.exe utility in conjunction with the above method?
Does anyone have any familiarity with Sharepoint and backups?
Source: http://community.livejournal.com/itprofessionals/48486.html
-
Updating multiple rows in sql
Date: 12/04/06
(C Sharp) Keywords: sql
I am trying to update multiple rows and multiple fields in sql using an update statement. So far I can't find a good way to do this. I've looked at using SQLBulkCopy object, but apparently that only works for inserts. I can open the connection, write all the separate update queries, then execute them, but this will take forever, almost as slow as updating the rows one by one. The schema of my datatable is different than that of the destination table.
So it looks like its going to be a for loop making updates unless someone knows of a better way...
thanks!
Source: http://community.livejournal.com/csharp/79016.html
-
Updating multiple rows in sql
Date: 12/04/06
(Asp Dot Net) Keywords: sql
I am trying to update multiple rows and multiple fields in sql using an update statement. So far I can't find a good way to do this. I've looked at using SQLBulkCopy object, but apparently that only works for inserts. I can open the connection, write all the separate update queries, then execute them, but this will take forever, almost as slow as updating the rows one by one. The schema of my datatable is different than that of the destination table.
So it looks like its going to be a for loop making updates unless someone knows of a better way...
thanks!
Source: http://community.livejournal.com/aspdotnet/79716.html
-
Sql 2000 to 2005 learning curve
Date: 12/11/06
(SQL Server) Keywords: sql
Hey all. I'm pretty experienced in Sql 2000 and have a task I could do in my sleep if I had that server. We currently have an Oracle server that we want to copy the data onto the SQL Server 2005 server. Had this been 2000, I'd put down a DTS Package, and call it a day. However, I don't see a section on DTS in SQL 2005. Online help mentions Integration Services, but I don't see that either.
My question is this: How do I create an Integration Services package similar to a DTS package, and where do I find that area of the server?
Thanks much!
Source: http://community.livejournal.com/sqlserver/54356.html