If e.g. I keep control markup in DB instead of ascx file.
How can I load control from string constant?
(of course if I don't want to save copy to disk)
Hi all,
it may be wrong place to ask this question, but i hope u all programmer must have the interesting naming convention of variables. i have seen many places that some variable names are very good n effective like
common variable names
$link
$db
$connect
$query
$stmt
$sql
$qry
$output
$result
$list
so please suggest me some good names for variable , bcoz all time i have to write
$x, $y etc.. if i want to save something instantly on page...that are even not relevant, so please suggest me good variable names
Hi
In my mode I am selecting a field as
$query1 = $this->db->query("SELECT dPassword
FROM tbl_login
WHERE dEmailID='[email protected]'");
How to return dpassword as a variable to my controller
I tried this way return dpassword;
Hi-- I have a UK date in the format "06/Apr/2010 13:24" that I need to insert into a mysql db date field.
The PHP strtotime function can't handle this string-- has anyone got any ideas other than writing a custom function?
Thanks!
I want to create a simple CMS for my asp.net-mvc site. Needs some help to start.
Will i save my whole page to db? what if my page contain links like
Url.Content("~/somepage")
When the admin will edit the page he will get the plain link not the Url.Content. How i can handle this in CMS?
i have a table called Cars and the primary key of the table is 'id'. I also have a field called 'name'. I would like to make sure no one enters the same name twice even though it wont break my db integrity.
what is the best way of doing this?
I have a table with
name varchar
address varchar
country varchar
city varchar
.....
to store address of location
example:
name|address|country
HaLong hotel|156 blahblah street|Vietnam
Hotel Ha Long|156 blah blah|Vietnam
Two rows above is duplicate data.
I have a form, when user submit new location. The code need to find akin records to give a message (ex: This location already in db, use it or create new?)
How to make a query to get akin record like this?
I have a textarea that saves data into a database. For some reason it is removing <object> tags from anything that I paste into it -- none of the other tags are removed, only <object> tags. I've never had this problem before and have done this same thing in times past -- any ideas as to what could cause this? I'm not filtering the data before it's saved to the db at all.
Hi, another iPhone newbie question...
I have the following:
NSPersistentStoreCoordinator
NSManagedObjectContext
NSManagedObjectModel
Is it possible to run queries directly on the store (since its a sqlite DB)? I'm trying to delete all the records from a tableview, and figured a "DELETE FROM table" would be nice and quick as opposed to looping through the records and removing them manually (which i'm also struggling with).
Thanks for your time,
James
I have an internal WPF client application that accesses a database.
The application is a central resource for a Support team and as such includes Remote Access/Login information for clients. At the moment this database is not available via a web interface etc, but one day is likely to.
The remote access information includes the username and passwords for the client's networks so that our client's software applications can be remotely supported by us. I need to store the usernames and passwords in the database and provide the support consultants access to them so that they can login to the client's system and then provide support. Hope this is making sense.
So the dilemma is that I don't want to store the usernames and passwords in cleartext on the database to ensure that if the DB was ever compromised, I am not then providing access to our client's networks to whomever gets the database.
I have looked at two-way encryption of the passwords, but as they say, two-way is not much different to cleartext as if you can decrypt it, so can an attacker... eventually. The problem here is that I have setup a method to use a salt and a passcode that are stored in the application, I have used a salt that is stored in the db, but all have their weaknesses, ie if the app was reflected it exposes the salts etc.
How can I secure the usernames and passwords in my database, and yet still provide the ability for my support consultants to view the information in the application so they can use it to login?
This is obviously different to storing user's passwords as these are one way because I don't need to know what they are. But I do need to know what the client's remote access passwords are as we need to enter them in at the time of remoting to them.
Anybody have some theories on what would be the best approach here?
update
The function I am trying to build is for our CRM application that will store the remote access details for the client. The CRM system provides call/issue tracking functionality and during the course of investigating the issue, the support consultant will need to remote in. They will then view the client's remote access details and make the connection
The following is my DB data, how can I sorting it by sid and prev_sid with php/mysql!?
sid prev_sid type
000 197 app_home
197 198 page_teach
198 218 page_teach
199 211 page_step
211 207 link
218 559 page_step
559 199 page_step
Result:
sid prev_sid type
000 197 app_home
197 198 page_teach
198 218 page_teach
218 559 page_step
559 199 page_step
199 211 page_step
211 207 link
000 197 198 218 559 199 199 211 207
I am using Lucene MultiFieldQueryParser and the implementation is as shown below
QueryParser parser = new MultiFieldQueryParser (Version.LUCENE_30,new String[] {"First Name","Middle Name","Last Name"}, standardAnalyzer); Query query = parser.parse(queryString);
and using it to find a match for the input string in my DB columns First Name, Middle Name and Last name .
I am able to get the hits with normal search and fuzzy search - The only problem I am facing is finding which column of the three generated the hit - Can you pls help me here - Thanks
i am doing a jquery back end search of data from a DB table..until i fetch the data from the table...how do i show am image like every where its shown like searching or something like tht
Hi,
I am making a doctor appointment slot booking mechanism,where in doctor appointment slots will be divided into 30 mins slot each...i have achieved all the working code.. 1 problem i am facing is that..this booking is made at 2 places i.e 2 receptions..so when 1 selects a slot(radio button) not yet confirmed and saved in DB.other reception must not be able to select .how do i do it.any help on this...how do i go abt it.
Is it possible to request data from an other controller in cakePHP?
For example, i created 2 folders in pages called search and update (both with a index.ctp) and a controller and model in the correct folders.
Both pages are using a different db source, and i wnat to display some data from the search controller into the view of the update page..
Is this possble?
Regards,
Swen
I want to execute query in side the db.sql file using MySQL 5.1 in windows environment. Can any one help me to this. I want to do this by runing a bat file.
HI
One of my requirement is to have prefix on all the tables of the django based project (Because db is hosted on shared server). I have used db_table Meta option to set the prefix for the tables which I have created.
Now my query is how do I set the prefix for tables provided by django.contrib.
Instead of auth_group django should create prefix_auth_group.... How do I do that?
Thank you very much...
I am working on cleaning up a mess that another programmer started. The created 2 identical databases for different locations but that obviously caused major issues. They are using cakePHP and there are quite a few relationships. I am pretty sure I will have to write a script to import that data from on DB to the other and keep all the relationships but was wondering if there is an easier way to do it.
I have in my model:
def presenter
@presenter ||= ProfilePresenter.new(self)
@presenter
end
The ProfilePresenter is a class that has methods like, get_link(), get_img_url(size), get_sex(), get_relationship_status() and other methods that have not to do with the model, not even with the controller but is used multiple times in the view.
So now i use them by doing this:
Profile.presenter.get_link
# or
Profile.presenter.get_img_url('thumb') # returns the path of the image. is not used to make a db query
I was psyched about the possibility of using SQLite as a database solution during development so that I could focus on writing the code first and dynamically generating the db at runtime using NHibernate's ShemaExport functionality. However, I'm running into a few issues, not the least of which is that it seems that SQLite requires me to use Int64 for my primary keys (vs, say, Int32 or Guid). Is there any way around this?
Currently im just using something like:
in the DB Table:
access: home,register,login
and then in each page:
if(!Functions::has_rights('content'))
{
Functions::noAccess();
}
is there more efficient way to do it, php & MySQL? i may want to gain access even to several parts a page, for example: user can read a page, but doesnt comment to it, and I dont want to build a separate system to each module.
Thanks in advanced, Tal.
Using Git or Mercurial, how would you know when you do a clone or a pull, no one is checking in files (pushing it)? It can be important that:
1) You never know it is in an inconsistent state, so you try for 2 hours trying to debug the code for what's wrong.
2) With all the framework code -- potentially hundreds of files -- if some files are inconsistent with the other, can't the rake db:migrate or script/generate controller cause some damage or inconsistencies to the code base?
Often I just need to get a single value from MySQL that I know exists there. I use the following construct:
$result = end(mysql_fetch_array(mysql_query('SELECT FOUND_ROWS()', $db)));
Is there a proper single function in PHP that would do this?
Hi, i would like to or need to use a database for my wpf project. It has to store "person" "team" "goals" and maybe 2 more things, nothing very big. Ive already used (worked) with databases in java / php (postgresql), but is there maybe an "easier" way to store the things.. i mean if the db is going to be big than i could use (postgre or mysql), but this one would be small.