MySQL stores the date in my database (by default) as 'YYYY-MM-DD' The field type for my date is 'DATE' (I do not need any time storage).. Is there a simple way to change it by default to DD/MM/YYYY ?
I call up different dates in 2 different tables, and no where in any of my code do I have anything resembling a date variable or anything! Hopefully this is a straight forward change?
Hello
I am trying to copy a file into a fold called profile i got that working but i need the page to be .html i also need data from mysql to put in the html page how do i go about that can anyone help me please
Hi,
I am using mysql database for my asp.net website.I need to implement to single sign on for multiple instances of my website.Currently to check if a user has logged in I am using a user control which checks for a "loggedin" cookie with single instance of the website.Now I need to extend the logic to achieve single signon for multiple instances of the same site.
Could someone please help.
Thanks.
MS SQL Server has a TABLE data type which can be used in stored procedures,
Does anybody know if MySQL has an equivalent data type?
I've had a look over the docs but can't seem to find anything, so I presume it doesn't exist, but perhaps somebody has created a workaround
Hi all,
Now I have my website built on PHP & Mysql. Consider this like a forum. Now when a user posts a reply in my website 1 (ex. www.website1.com), I want to be able to show the starting thread and it's related replies in a sister website of mine. I want to do this in a way that it does not show the rest of the page & other page contents (like logo etc.). I don't think iframe would be a solution because an iframe would embed the whole page and the users visiting my sister website (totally different domain i.e. www.website2.com) would be able to see all the page contents, like logo etc. I want to avoid that. I want to make them see only limited information from website 1 and only the info. that I intend.
I hope that makes sense. In a way, you could say that I am trying to replicate my 1 website, and show only a limited part of it. Users browsing 2nd website can post a reply in the 2nd website and it should automatically be posted & visible to the visitors of the website 1. Users of website 1 should not know that a user of website 2 has posted it. They would feel that some user from website 1 has posted it. Do I have to use 2 separate mysql DB or just 1? I think it would be problematic if I am trying to use different DB. I also feel I might have to face DB connectivity issues as I can connect to only 1 DB at a time.
It's basically like users of website1.com should feel that they are replying to users of website1.com & users of website2.com should feel that they are replying to users of website2.com. (I need it this way to bridge the gap between them). At the same time I want to make the front end of the websites different so that they don't feel that they are replying to some other users outside the domain. These websites would be under my control and I will have access to the source code at any time. If I need to change the source code, these changes are welcome.
Is this really possible?
Thank you in advance.
I have a table called cc_calls and there I have many call records I want to count them and group them in months I have a timestamp called starttime and I can use that row to extract the month, also limit the count for 12 months
the results should be like:
Month Count
January 768768
February 876786
March 987979
April 765765
May 898797
June 876876
July 786575
August 765765
September 689787
October 765879
November 897989
December 876876
Can anyone guide me or show me the mysql query that I need to get this result.
I am playing around with PHPFog and as a result I ended up with a MySql database. I am trying to figure out how to connect to it with a success message.
PHPFog says use this:
mysql_connect(
$server = getenv('MYSQL_DB_HOST'),
$username = getenv('MYSQL_USERNAME'),
$password = getenv('MYSQL_PASSWORD'));
mysql_select_db(getenv('MYSQL_DB_NAME'));
So I basically plug my variables into the above? Or Do I do something different?
Thanks,
Jim
Hello,
tried connecting to mysql server in realbasic using the folowing code:
dim db as MySQLCommunityServer
db=New MySQLCommunityServer
db.host="192.168.240.129"
db.port=3306
db.databaseName="test"
db.userName="test"
db.Password="test"
If db.Connect() then
txt1.Text = "Connected"
else
txt1.Text = "Connection failed!"+ chr(13)+db.ErrorMessage
end if
and i get the following message
connection failed!
any suggestions..
Thanks
I'm new to SSH. How to copy a .gz file from one server to another using SSH?
I'm using cron to backup mysql databases and want to also automate the process of copying the .gz files a different web host.
Any information on the limit of file size that can be copied would also be great. The backup file size range from 100 MB to few GB.
hi all,
I am looking some help in php+MySQL+jquery
I have 2 tables
table1
table 1 have 4 colume
(id, title, desc, thumb_img)
tabel2
table 2 have 3 colume(id, table1id, img)
I just want to compare 2 table with the value of $_get['QS'];
and show the records from both (title, desc, img)
Looking forward for the help.:)
Hello guys, I have datetime-row in mysql database. I have to check time between now and that date using php. If the range is bigger then 1 month - do somtething.
I tried something like this:
$dateFromMysql = strtotime($rowData);
$currentDate = date("m/d/y g:i A");
And then comparsion by hands. It's ugly.
Is there an easy way to order MySQL results respectively by WHERE id IN (...) clause?
Example:
SELECT * FROM articles WHERE articles.id IN (4, 2, 5, 9, 3)
to return
Article with id = 4
Article with id = 2
Article with id = 5
Article with id = 9
Article with id = 3
and also
SELECT * FROM articles WHERE articles.id IN (4, 2, 5, 9, 3) LIMIT 2,2
to return
Article with id = 5
Article with id = 9
Hi,
I have a sql script file that upon import creates a table in a MySQL database and fills it with 2800 record. These are all the postal codes for the country Belgium.
Now I would like to make a Ruby on Rails database migration file from this. Any idea how I can do this?
Thanks,
Michael
I am designing a desktop application in C#, which needs to be connected to my online mysql database. I tried to give access in control panel a "%" which means from any IP, but it is not working. May be the hosting provider (bigrock) not allowing that.
Alternatively, I am trying to write some code in online on PHP which will get the "sql" as parameter and returns the output as JSON format using json_encode.
Is there any alternate methods which is better approach.
Hi, if an INSERT and a SELECT are done simultaneously on a mysql table which one will go first?
Example: Suppose "users" table row count is 0.
Then this two queries are run at the same time (assume it's at the same mili/micro second):
INSERT into users (id) values (1)
and
SELECT COUNT(*) from users
Will the last query return 0 or 1?
Hello,
I have a slow mySQL query in my application that I need to re-write. The problem is, it's only slow on my production server and only when it's not cached. The first time I run it, it will take 12 seconds, then anytime after that it'll be 500 milliseconds.
Is there an easy way to test this query without it hitting the query cache so I can see the results of my refactoring?
Thanks!
When the user check more than one (checkbox) option which are then combine into a string of "apple,orange,pear"
SELECT id, pos, FROM $db WHERE dtime>='$now' AND jsub IN ('$arr[1]') ;
When I pass the string to $arr[1], it won't work correctly, how do I split into array and get mysql IN function to process correctly?
Hello,
My code contain
SELECT * FROM newchap WHERE company LIKE '%$company%' OR Category LIKE '%$cat%'
It works perfectly however, when the field $company contain empty, it return all result in MYSQL.
How to prevent it?
I'm writing a game for iPhone, and I want an online leaderboard using mySQL, which i'm very familiar with.
How do I implement this in my app?
I would assume there's a framework/library i need to obtain?
I'm trying to pass a table name into my mysql stored procedure to use this sproc to select off of different tables but it's not working...
this is what I"m trying:
CREATE PROCEDURE `usp_SelectFromTables`(
IN TableName varchar(100)
)
BEGIN
SELECT * FROM @TableName;
END
I've also tried it w/o the @ sign and that just tells me that TableName doesn't exist...which I know :)
Is there something i can use to track how long my mysql queries take? perhaps log them if they take a certain amount of time? or track all queries but only hold the longest query time? using this with C# .NET with ASP.NET.
I'd like to use this to occasionally check if my queries are getting slow.