I'm a beginner in php, and I am trying to create a login and logout. But I am having problems in logging out. My logout just calls for the login form which is this:
<?
session_start();
session_destroy();
?>
<table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<form name="form1" method="pos...
Apologies for my longest question on SO ever. I'm trying to interface with a php frontend for a mysql database in ROOT (a CERN framework in C++ for high energy physics analysis). To start off with, I tried to get this php interface to play nice with wget and curl first because I'm more familiar with them. The following command works:
wg...
Suggest me solution to track the change in test DB and replicate in Another DB...
My Client need a script or any solution, if he has two Database, One Test DB in which he tests his data on test portal and if he find it appropriate he can use those changes to be done in main DB to display on Live site.. Fior this he needs the solution to...
I'm doing a join between the "favorites" table (3 million rows) the "items" table (600k rows).
The query is taking anywhere from .3 seconds to 2 seconds, and I'm hoping I can optimize it some.
Favorites.faver_profile_id and Items.id are indexed.
Instead of using the faver_profile_id index I created a new index on (faver_profile_id,id), ...
Using MySQL, I have three tables:
projects:
ID name
1 "birthday party"
2 "soccer match"
3 "wine tasting evening"
4 "dig out garden"
5 "mountainbiking"
6 "making music"
batches:
ID projectID templateID when
1 1 1 7 days before
2 1 1 1 day before
3 4 2 2...
Assume that the following MySQL files have been restored from a backup tape:
tablename.frm
tablename.ibd
Furthermore, assume that the MySQL installation was running with innodb_file_per_table and that the database was cleanly shutdown with mysqladmin shutdown.
Given a fresh install of the same MySQL version that the restored MySQL f...
my data includes arabic characters which looks like garbage in mysql but displays correctly when run on browser. my questions:
how do i html-encode the output?
if i add this to all my files: <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> i get this error: Error: Incorrect string value: '\xE4\xEE\xC3\xD8\xEF\xE6...'...
What is the most efficient way to do this?
Right now I am doing it this way..
$m= date("m");
$de= date("d");
$y= date("Y");
$userid = $_SESSION['user_id'];
//today
$date = date("Y-m-d");
$today = mysql_query("SELECT *
FROM cdr
WHERE accountcode = '$userid'
AND calld...
How to identify foreign key in MySQL DB Table?
...
Which of the following is faster, or are they equivalent?
(grabbing recent most records from a TIMESTAMP COLUMN)
SELECT UNIX_TIMESTAMP(`modified`) stamp
FROM `some_table`
HAVING stamp > 127068799
ORDER BY stamp DESC
or
SELECT UNIX_TIMESTAMP(`modified`) stamp
FROM `some_table`
WHERE UNIX_TIMESTAMP(`modified`) > 127068799
ORDER BY `mo...
What advice can you give me on how to track down a bug I have while inserting data into MySQL database with .Net?
The error message is:
MySql.Data.MySqlClient.MySqlException: Duplicate entry '26012' for key 'StockNumber_Number_UNIQUE'
Reviewing of the log proves that StockNumber_Number of 26012 has not been inserted yet.
Products in...
Hi There, I have a form that shows results from a database query, these results can have many other assets ajoined to them and I wanting to find a way of showing how many assets each elemement has. For example my table is of areas of england an other table has where the users live I current have this code,
$this->db->select('*');
$thi...
Hello, well the title says it all. Does anyone have an idea? Would need to lock the table for that long on production site, so it is kinda important.
Also, do you have any suggestion how such query could be optimized?
Thanks!
...
Hi I need the following php script to do a currency conversion using a different XML file.
Its a script from white-hat design
http://www.white-hat-web-design.co.uk/articles/php-currency-conversion.php
The script needs to be amended to do the following:
1, The php script downloads every 24 hours an xml file from
rss.timegenie.com/fore...
I've just started to investigating how I should optimize my database. Indexing seems to be a good idea, so I want to index a VARCHAR column, the engine is MyISAM.
From what I've read, I understand that an index is limited to a size of 1000 bytes. A VARCHAR character is 3 bytes in size. Does this mean that if I want to index a VARCHAR c...
http://i.imgur.com/JdsUK.jpg
I created a table like the picture above.
What are the "Indexes"? primary key? unique?
It works well without setting indexes.. What do they do? why do I need them?
Also, I set all String fields to TEXT because I didn't know how many characters I need. Is this a good idea? I don't see any difference.
Thank...
I'm developing a simple classroom system, where teachers manage classes and their subjects.
I have 2 levels of access in my teachers table, assigned by an integer (1 = admin, 2 = user)... Meaning that the headteacher is the admin :)
A teacher (of level 1) can have have many classes and a class can have many teachers (so I have 'Teacher...
I want to access a MySQL database from Java, but remote connection is disabled by the host.
So I will send the data to PHP and then PHP will locally access the database.
The data is pretty big (about 2~4kb)
I've never done this before.
What should I do?
...
we have three types of data (tables):
Book (id,name,author...) ( about 3 million of rows)
Category (id,name) ( about 2000 rows)
Location (id,name) ( about 10000 rows)
A Book must have at least 1 type of Category (up to 3) AND a Book must have only one Location.
I need to correlate this data to get this query faster:
Se...
Hello fellow experts,
I have a huge table and I want simple sorting.
It could be so easy. I could just create an index and do some really fast sorting thanks to that index.
But my client wants to put NULLs to the end, which is complicates the whole situation.
Instead of simple: SORT BY name ASC I have to do SORT BY name IS NULL ASC, ...