How do I drop selected tables in Rails? I want to drop all tables from a database with a given prefix. PHPMyAdmin would be very useful at this point.
Thanks
I'm converting database from Teradata to SqlServer. I've noticed all tables and procedures are named by the prefix "dbo." (e.g. "dbo.Table1").
I would like to know if and how I can get rid of "dbo" because it would make the conversion task a lot more easier.
Hello, in my web page a user fill a form who send information to a MySql database. One of the data inputs sent is a date/time, in the format date('l jS \of F Y h:i:s A');
(I can change the format as needed)
So when the user submits the form i wanna check if the actual time/date is 30 seconds more than the sent time/date in order to allow or not the submission of the form. Thanks!
I want to have some way of backing up the user defaults to a property list or XML, or some other appropriate file format that can be transfered over the net. How could I get a backup of these so that I can send them to a webserver and retrieve them back to the device and read them in to the user defaults database?
Hi.I created app that searches via blue tooth mac addresses and compare match them with data base. But I want to try not matching Mac Addresses , I want to make it like taking photo and matching with in database. For this what should I do? Where to start? I have an DB that includes all value for students with an Mac addresses I thing instead of Mac addresses I will add only photos.But Matching Two photo is hard way?It don`t have to be like FBI using :)
i have oracle background,
i am looking for oracle v$sql view in mysql in order to see last queries has been run on all sessions in database
how can i see this in mysql ?
I am using Oracle 11g and when I query data from database manually, it looks ok. But when I view it using Notepad++, there is a special character that gets inserted anywhere in the xml produced. Please see image below:
I tried everything and deleted some parts of the xml, updated the db and query again but the invalid character just differ in location. Any idea is much appreciated, thanks!
Best regards,
Racs
How would you implement a search facility within an ASP.NET hybrid application? I'm really tempted to start rebuilding our Intranet application using ASP.NET MVC & Web Forms (mainly MVC though).
I know how to search the dynamic content from a database, but I'm struggling with the static content in the Views. Surely this should be an easy task with routing and a sitemap.
I was wondering if the code below is the correct way to use mysqli_real_escape_string() when storing users data in a database.
Here is the PHP & MySQL code.
if (mysqli_num_rows($dbc) == 0) {
$mysqli = mysqli_connect("localhost", "root", "", "sitename");
$dbc = mysqli_query($mysqli,"INSERT INTO info (user_id, url)
VALUES ('$user_id', 'mysqli_real_escape_string($url)')");
}
if ($dbc == TRUE) {
$dbc = mysqli_query($mysqli,"UPDATE info
SET url = 'mysqli_real_escape_string($url)'
WHERE user_id = '$user_id'");
For some reason I can't seem to get the MySQL Net Connector to work with C# outside of the IDE. I have a very simple program working just fine in the IDE (connecting to the database and everything) but when I publish the code and run the .application file (on my local computers desktop or off the company server) it says it can't connect to any of the specified MySQL hosts.
Any help would be greatly appreciated! :(
Thank you
I have a MySQL database with some URLs in it. One URL per row. Each URL has my script on it. What I am wanting to do, is check if the file is still there via a PHP script. Not check if it 404'd, but rather check if it has been modified or replaced. Is this possible? If so, how would it be accomplished?
After I do some change in my database, that involves significant change in my views, I would like to redraw, re-execute onCreate.
How is that possible?
In my application i have an in-box.If new message is arrived I need to increment the unread count.For that Whether I need to make the database connection for every second to find the new message is arrived?Is there any other methods?
How do you prevent malicious input in WYSIWYG editors like TinyMCE?
I have a system with users who are not "tech savvy" (so no WMD) and need a rich text editor that posts its content into a database.
I'm worried about scripting attacks and malicious input code.
Let's say I have a backgroundWorker1_DoWork that finds a value in a database and returns it in e.Result. Let's say I also have a backgroundWorker1_RunWorkerCompleted that reads the result.
What I want to be able to do is based on e.Result, I can re-run backgroundWorker1_DoWork, and this I am not sure how to do.
I'd really appreciate any help.
I have two tables in my database, one contains a list of items with other information on these items. The other table is contains a list of photographs of these items.
The items table gives each item a unique identifier,which is used in the photographs table to identifier which item has been photographed.
I need to output a list of items that are not linked to a photograph in the second table. Any ideas on how I can do this?
Let's say I have an array of objects from the same class, with two attributes of concern here: name and created_at.
How do I find objects with the same name (considered dups) in the array, and then delete the duplicate record in the database. The object with the most-recent created_at date, however, is the one that must be deleted.
Does anyone have experience in developing a standalone app with Silverlight using SQLite database? App should be distributed on CD or DVD for Windows OS and has to have autorun, with possibility to install .NET Framework if needed.
How difficult is to develop that kind of app for someone who has two years experience in Asp.NET web forms apps?
Thanks in advance for your answers.
I am able to login a user, but while processing to the next page (memebers area) I can't display any user info let alone print the $_SESSION[email]. I am not sure what's up. Below is the login code and the testing members are page.
Login page:
session_start();
//also in a real app you would get the id dynamically
$sql = "select `email`, `password` from `accounts` where `email` = '$_POST[email]'";
$query = mysql_query($sql) or die ("Error: ".mysql_error());
while ($row = mysql_fetch_array($query)){
$email = $row['email'];
$secret = $row['password'];
//we will echo these into the proper fields
}
mysql_free_result($query);
// Process the POST variables
$email = $_POST["email"];
//Variables
$_SESSION["email"] = $_POST["email"];
$secret = $info['password'];
//Checks if there is a login cookie
if(isset($_COOKIE['ID_my_site']))
//if there is, it logs you in and directes you to the members page
{
$email = $_COOKIE['ID_my_site'];
$pass = $_COOKIE['Key_my_site'];
$check = mysql_query("SELECT email, password FROM accounts WHERE email = '$email'")or die(mysql_error());
while($info = mysql_fetch_array( $check ))
{
if (@ $info['password'] != $pass)
{
}
else
{
header("Location: home.php");
}
}
}
//if the login form is submitted
if (isset($_POST['submit'])) { // if form has been submitted
// makes sure they filled it in
if(!$_POST['email'] | !$_POST['password']) {
die('You did not fill in a required field.');
}
// checks it against the database
if (!get_magic_quotes_gpc()) {
$_POST['email'] = addslashes($_POST['email']);
}
$check = mysql_query("SELECT email,password FROM accounts WHERE email = '".$_POST['email']."'")or die(mysql_error());
//Gives error if user dosen't exist
$check2 = mysql_num_rows($check);
if ($check2 == 0) {
die('That user does not exist in our database. <a href=add.php>Click Here to Register</a>');
}
while($info = mysql_fetch_array( $check ))
//gives error if the password is wrong
if (@ $_POST['password'] != $info['password']) {
die('Incorrect password, please try again');
}
else
{
// if login is ok then we add a cookie
$_POST['email'] = stripslashes($_POST['email']);
$hour = time() + 3600;
setcookie(ID_my_site, $_POST['email'], $hour);
setcookie(Key_my_site, $_POST['password'], $hour);
//then redirect them to the members area
header("Location: home.php");
}
}
}
else
{
// if they are not logged in
?>
<?php
}
?>
home.php
session_start();
if(!isset($_SESSION['email'])) {
header('Location: login_test3.php'); die('<a href="login_test3.php">Login first!</a>');
}
//Variables
$_SESSION["email"] = $email;
print $_SESSION['name'];
UPDATE
Just realized the existing code gets in to the home.php file but will not echo anything. But as soon as you hit refresh the session is gone.
How do I show the dates number format next to its name in the array using PHP? So that the number format is saved in the database and the month name is displayed?
Here is the php code.
$month_options = array("Month", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
I am currently adding Oracle 10.2.0. as a viable database to a product. The product originally allows connection to SQL Server and I have found some extended stored procedures.
Is it possible to produce similar extended stored procedures for Oracle with C++?
If so, how do I accomplish this? Example code would be much appreciated.
I have a simple Zend Framework that has a view script to add records to the database. This is a silly question IMHO, but how can I use the add view script to edit the record as well??
I have played around with a few scenarios to no avail.
Thanks,
Steve
I have an application and around 20 accounts are created per minute (on average). I need to implement a new feature which requires the ID of the last insert.
I am using PDO.
The question is, lets say 5 users create accounts at exactly the same time. Will it return the ID from the database for that users profile that was just created, or will it return the last insert?
If you get what I mean.
I have a query which returns multiple columns from the database using LINQ
var donors = from d2 in db.Donors
where d2.Status == "Pending"
select new { donorID = d2.donorID, bloodGroup = d2.bloodGroup, contactNo = d2.contactMobile, status = d2.Status };
now I want to display the results in different Labels accessing one column value from donors resultset.
ex:
Label1.Text = donorID;
Label2.Text = bloodGroup; ...and so on
please help me achieve this.