w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
how to get the information of about database events and actor information
Look at the MODULE, ACTION and CLIENT_INFO columns of V$SESSION. Then, in the package(s) and/or trigger(s) you suspect are performing the update, call DBMS_APPLICATION_INFO.SET_MODULE and DBMS_APPLICATION_INFO.SET_ACTION: BEGIN DBMS_APPLICATION_INFO.SET_MODULE(trigger_name, 'trigger start'); -- some code... DBMS_APPLICATION_INFO.SET_ACTION('updating employee'); -- code which updates the employee table DBMS_APPLICATION_INFO.SET_ACTION('doing something else'); -- more code... DBMS_APPLICATION_INFO.SET_MODULE(NULL, NULL); END; See also the example provided in the usage notes.

Categories : Oracle

How to save the information from additionally added fields in CreateUserWizard in separate database, which is different from the Membership database?
Inorde to store your custom data, you need to make use of, Membership profiles. You find more info over here http://msdn.microsoft.com/en-us/library/taab950e%28en-US,VS.80%29.aspx http://weblogs.asp.net/scottgu/archive/2005/10/18/427754.aspx http://odetocode.com/Articles/440.aspx

Categories : C#

Rails API makes multiple database queries when similar code in Rails console only makes one database query
It looks like you have a N+1 problem, you can read more about this here - http://guides.rubyonrails.org/active_record_querying.html#eager-loading-associations

Categories : Ruby On Rails

How do i check database table through datatable and extract information of another column of database table?
Since you are loading DataTable from same reader it may be closed after the loading complete. As Side node, you better use parameters, using statements etc like below string queryString = "Select [friendshipstatus] from [tblfriend] where [username] = @username and [friend] = @friend"; using (SqlConnection connection = new SqlConnection(connectionString)) using (SqlCommand command = new SqlCommand(queryString, connection)) { command.Parameters.AddWithValue("@username", username); command.Parameters.AddWithValue("@friend", friendname ); connection.Open(); using (SqlDataReader reader = command.ExecuteReader()) { if(reader.Read()) // you have matching record if this condition true { friendship = reader.GetString(0); // get the value of frie

Categories : C#

Rails Many To Many, add records with extra information
There are several ways you can do this. The simplest way would be to add the shows directly: game.shows << special_users.map{|u| Show.new(user: u, special: true) } game.shows << non_special_users.map{|u| Show.new(user: u, special: false) } Alternatively, you can create associations that have the 'special' condition baked-in: #game.rb has_many :special_shows, lambda{ where(special: true) }, class_name: 'Show' has_many :non_special_shows, lambda{ where(special: false) }, class_name: 'Show' has_many :special_users, through: :special_shows, source: user has_many :non_special_users, through: :non_special_shows, source: user game.special_users << special_users game.non_special_users << non_special_users If you don't want to set up a new scope for special and non-s

Categories : Ruby On Rails

Ruby on Rails Pulling Information From Another Site
This is quite a broad question. Depending on whether the web applications that you're getting your data from have APIs or not, you would either use those to retrieve the data or you'd have to web scrape it. For accessing an API you could use Net:HTTP or HTTParty or similar. For web scraping you'd want to use similar libraries for retrieving the page and some parser like Nokogiri to parse the HTML. In both cases you'd want to store the results in your own database to avoid having to scrape/query API upon every request.

Categories : HTML

How To Use LDAP Authentication Information In Rails devise_ldap_authenticatable?
Please read devise_ldap_authenticatable documentation, and follow this screencast. I think you can add in ldap.yml additional entries for your credentials such as admin_user and admin_password.

Categories : Ruby On Rails

Ruby on rails passing information from session into db
You can have the current_user (for example) method: def current_user @current_user ||= User.find_by_id(session[:user_id]) end If you already have this, you can create post with: @post = current_user.posts.create(params[:post]) You should also check, of course, if any user is signed in before creating post, or you'll have NoMethodError.

Categories : Ruby On Rails

Amount of information on Controller Method - Rails
This would be good occasion to use hashes. For example, @attr_counts = {:answered => answered.length, :asked => asked.length, :pending => pending.length, :favorited => favorited.length} @medal_lengths = {:gold => thanks_received(:awesome).length, :silver => thanks_received(:great).length, :bronze => thanks_received(:good).length}

Categories : Ruby On Rails

Php is not printing database information
Change your Insert query to mysqli_query ($con, "INSERT INTO alarms(Title, Description, DT) VALUES('getSucked', 'Agha will smd', '2013-08-05 00:15:12')"); Your Insert query will fails when you gave the spaces.Try to put them in quotes..

Categories : PHP

GET variable with SQL to get information from Database
I think what you are asking is getting a single article out of the database through a get. If that's the case: Have an url: http://www.url.com/page.php?article=5 Now you can go in your php file to retrive the article. $articleId = $_GET['article']; Now you use this variable within your query to select the article with the where clause: WHERE article_id = $articleId Sidenote: Stop using mysql_* functions. Check the warning above: http://php.net/manual/en/function.mysql-query.php Alternative: mysqli or PDO. Also make you validate everything and prevent SQL injections.

Categories : PHP

PHP - Store information with NO database
Cookies might be helpful. I can't think of any other secure way. This isn't too graceful either. http://support.mozilla.org/en-US/kb/cookies-information-websites-store-on-your-computer

Categories : PHP

PHP paging database information
Contrary to your overview's select you've got no filter on the select used for the page-count. As such the latter will be (potentially) higher, thus indicating a page that isn't there. You should change the $sqlPage line to the following to get a matching amount of pages. $sqlPage = $mysqli->query("select count(id) from propertyinfo where Property like '%$property%' and NumBed >= '%$bedroom%' and NumBath >= '%$bathroom%' and Footage >='$sizeMin' and Footage <='$sizeMax' and Price >= '$priceMin' and Price <= '$priceMax' and utilities like '%$check%' and TermLease like '%$termlease%'"); Also you should change the $total_pages line to the following, as you might otherwise get a division by 0 error: $total_pages = $total_records > 0 ? ceil($total_records / 5) : 0;

Categories : PHP

values not being set from database information
You are not printing the result here and because of that it is not displaying the values. <td><input type="text" name="f_name" value="<?php echo $row['f_name']; ?>" ></td> <td><input type="text" name="l_name" value="<?php echo $row['l_name']; ?>"></td> <td><input type="text" name="email" value="<?php echo $row['email']; ?>"></td> <td><input type="hidden" name="id" value="<?php echo $row['id']; ?>"></td>

Categories : PHP

How to update information into database wpf
You can pass one more parameter indicating that you want to update only addidionalInformation, for example: public static void Update(Resident resident, SqlConnection connection, SqlTransaction transaction, bool updateOnlyAdditionalInformation) { StringBuilder sqlString = new StringBuilder(); SqlCommand command; sqlString.Append("UPDATE [Resident] SET "); if (!updateOnlyAdditionalInformation) { sqlString.Append("title = @title, "); sqlString.Append("firstName = @firstName, "); sqlString.Append("surname = @surname, "); sqlString.Append("dateOfBirth = @dateOfBirth, "); sqlString.Append("photo = @photo, "); sqlString.Append("doctorID = @doctorID, "); sqlString.Append("roomID = @roomID, "); sqlString.Append("allergies = @al

Categories : C#

Ruby on rails get mysql information depending on option value
You should use options_for_select to generate your options: http://apidock.com/rails/ActionView/Helpers/FormOptionsHelper/ <%= options_for_select([["Dollar", "$"], ["Kroner", "DKK"]]) %> #generates <option value="$">Dollar</option> <option value="DKK">Kroner</option> Combined with a select_tag to generate the select: http://api.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html#method-i-select_tag <% options = "<option>Red</option><option>Green</option><option>Blue</option>".html_safe %> <%= select_tag "colors", options %> <div id="product_details"></div> #generates <select id="colors" multiple="multiple" name="colors[]"> <option>Red</option> <option>Green<

Categories : Jquery

Rails 4 issue with mysql database tables after upgrade from Rails 3.2
One option (not a fix but may let you move forward). If this is just a development or local database, drop the database manually and update the schema_migrations table and then rake:db migrate to recreate from scratch.

Categories : Ruby On Rails

How to make a variable from database information
The following should work: $row=$companyNameRet->fetch_assoc(); $myvariable=$row['company_name']; good luck! For multiple variables, $row will be populated $row['column_name'] for as many column names as you have. It can get quite confusing if you are decrypting or doing anything fancy with functions so it may be worth assigning aliases: SELECT column1 firstcol,column2 secondcol,column3 thirdcol... In this case, $row would have the aliases as keys: $row['firstcol'], $row['secondcol'] etc... Try var_dump($row) to see what you get. It is most educational to do so. You can fetch multiple rows by using: while($row=$companyNameRet->fetch_assoc()) { // $row will contain consecutive rows selected from your db. } W3 Schools provide a decent tutorial on mysqli basics

Categories : PHP

Adding information from variables to database PHP
Replace echo $row2['first_name']; with return $row2['first_name'];. If you want to get some value from the function, you should use return operator to pass the value back. It has nothing to do with printing the value with print or echo.

Categories : PHP

PHP Dropdown pulling information from SQL database
You're not selecting the number from your database. Once you do, put the text in between the opening/closing tag, and leave the numeric value in the value attribute. echo '<option value="', htmlspecialchars($row['id']), '">', htmlspecialchars($row['currency']), '</option>';

Categories : PHP

imploding and using database information in arrays
Remove the implode function, $separateIps = mysqli_fetch_all($getBlockedUsers, MYSQL_NUM); in_array expects parameter 2 to be an array. When using implode you will get a string instead of an array.

Categories : PHP

How can i store database information in JSF2
It is generally a good idea to store these kind of values in a .properties file. They can then be accessed via java.util.Properties (http://docs.oracle.com/javase/7/docs/api/java/util/Properties.html) Here is a good tutorial describing how access these files and their values, I suggest you start with this: http://www.mkyong.com/java/java-properties-file-examples/ (More information: http://en.wikipedia.org/wiki/.properties) In my IDE, I usually create a new source package /src/main/config and put all my configuration-concerning .properties and .xml files in there. If you do it this way, you need to access it like this from within your jsf application: String configFilePath = "configuration.properties"; props = new Properties(); InputStream propInStream = Thread.currentThread().getCont

Categories : JSF

Rails Devise Registration Form with Credit Card Information
In general you should create a new model related to user that stores all credit card information in it. Then you could create a specific controller action that handles the default user sign_up and includes the credit card info inside this new table. e.g: inside new model's controller, UserCreditCardController.rb: def sign_up_credit_card user = User.create(params[:name], params[:email] ....) UserCreditCard.create(user.id, params[:credit_card_number] ...) sign_in(user) end This way, not only you can solve your problem. But you can add support for multiple Credit Cards, without having to polute this information to user's model.

Categories : Ruby On Rails

ruby on rails best place to put layout database code (common database calls)
I found a way is to use before_filter. by defining the filter in the ApplicationController (so that you can access it from any controller). class ApplicationController < ActionController::Base # .. protected def load_messages @messages = Message.all end end and then in the any controller: class FooController < ApplicationController before_filter :load_messages def index # @messages is set end end

Categories : Ruby On Rails

Heroku: Dump Postgres database into local SQLite3 database for Rails project
Please read through https://devcenter.heroku.com/articles/heroku-postgres-import-export and follow those to export.

Categories : Ruby On Rails

Rails / postgresql Migrate Data from Database to Newly created database
I've used the yaml_db gem to migrate DBs: https://github.com/ludicast/yaml_db - this gem adds some rake tasks that are helpful After installing the gem, you can run rake db:data:dump to save your database to a .yml file. Then, after changing your database configuration, you can run rake db:data:load to load the data into your new database.

Categories : Ruby On Rails

Connection Information for Oracle SQL Developer database
The reason why you are getting the error is because you have not specified service name or SID as it doesn't know to which instance it should connect. I suppose you are using one of the latest versions of SQL Developer available for download. Right click connections and choose New Connection from context menu, you will get a window like one is pasted below, there you enter connection details and do not forget to enter either service name or SID. Hope this helps.

Categories : Oracle

How to make multiple pop up div based on database information?
I thought about this problem diferently than you. So here's my idea. 1st- you don't need multiple divs cuz using jquery & php you can manipulate a single div however you want. 2nd- saying you display your 15 persons 1st makes the job easier. Let's say you store them into some links like the next example and we asume we have an ID, a Name, an Age and a Location: <?php $sql = "SELECT * FROM persons"; $result = mysql_query($sql); while(mysql_fetch_array($result)) { echo '<a hred="#" class="trigger" id=' . $result['id'] . '>' . $result['name'] . '</a><br />'; } Now using AJAX we dispaly the results for hovering any link: $('a').mouseenter(function(e) { var myperson = $(e.target).text(); $.ajax({ url: "details.php?current=" + myperson, success: function(html){ if(h

Categories : Javascript

how to store information in a database and display it in a listView?
Try to import the project from here and just observe and make changes accordingly it is very easy and helpful.

Categories : Java

Display information from MySQL Database on webpage
There doesn't seem to be any problem with your query, so if you want to just format it as a table, you could do echo "<table border=1>"; while ($row = mysql_fetch_array($result) { echo '<tr><td>'; echo $row['team1']; echo '</td><td>'; echo $row['team2']; echo '</td></tr>'; } mysql_close($con);

Categories : PHP

How to elegantly poll/pull information from a database?
Do you have look at Hibernate ? This is an elegante object layer over SQL database. Then you can push triggers on your database to push the event. When you have a event to your data you send it to your web application via long query (it is an ajax query with very very very long timeout, the query is re-send after a event is receive). A crazy design should also use a two way messaging system, one for message incoming into the DB one for other outputing from DB. If you really like crazy thing you could thing of cache using a DB4O database (a cache for your SQL Server) embedded into a servicemix - redhatfuse. There easy way with servicemix because of the predeployed broker(activemq) and fuse with it's nice fabric system.

Categories : SQL

How to put database connection information to a separate file?
One of the way to approach is to have a BaseDAO with a method which returns the Connection object, where you can have the following code - public class BaseDAO { public Connection getConnection() { Class.forName("com.mysql.jdbc.Driver"); String url = "jdbc:mysql://localhost:3306/saloon"; String name = "root"; String password = ""; Connection con = DriverManager.getConnection(url, name, password); return con; } } You can then extend this BaseDAO in all the other DAO classes or create an object of the BaseDAO class and get the Connection object. Your remaining code would be in a separate DAO class. (Lets call it GetDataDAO). public class GetDataDAO extends BaseDAO { Connection con = getConnection(); Statement stmts = null; String query = "select userid, use

Categories : Java

How to update database when the information in a website is updated?
There are couple of suggestions for the periodic read of the website: 1 . If you are using linux/unix based system then you can create a shell script to run your java program. And add that script to cron with the desired periodicity. or 2 . You can use frameworks like quartz, which allows you to run the scheduled task at the desired intervals. For your second problem of reading the entire site content and storing it to the file for futher analysis, I would recommend to use JSoup for html parsing. Jsoup is a Java library for working with real-world HTML. It provides a very convenient API for extracting and manipulating data, using the best of DOM, CSS, and jquery-like methods. Combining both the recommendations should help you to get the desired solution.

Categories : Java

Facebook information not populating Parse database
Use more whitespace, and declare more instance variables. Open your code out so you can find your problem easier. For instance, pull out the value for result[@"data"][0][@"name"] and assign it to a local variable of it's own. Subclass your entity in CoreData, so it's easier to manage attribute assignment with setters and getters. Then set breakpoints and examine each step of the code.

Categories : IOS

Retrieve database information from DBML files
Short answer is no. If you have database backups you can restore these and get the details from there. If you don’t have these but your database was in full recovery mode you can try to examine transaction log and see if you can get any info from there. See this for more details SQL Server Transaction Log Explorer/Analyzer

Categories : Sql Server

Uploading Information to a database with a disabled textbox
You forgot give id for the text field. Try this <input type="radio" name="TermLease" value="No" onclick="TermLeaseMonths.disabled=true">No <input type="radio" name="TermLease" value="Yes" onclick="TermLeaseMonths.disabled=false">Yes | How many months:<input type="hidden" name="TermLeaseMonths" value="0" /> <input type="text" name="TermLeaseMonths" id="TermLeaseMonths" size="1" disabled="true">

Categories : PHP

Ajax pulling information from second select and database
I think you need to concat the values of the dropdownlist. Something like: <script type="text/javascript"> function server(aform) { var xmlhttp; if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("txtHint").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","getuser.php?q="+ product.value +"&" +"p="+product_i.value ,true); xmlhttp.send(); } </script>

Categories : PHP

Using Sqlite3 test database and Postgres dev/production database in Rails
With all the warnings acknowledged, the answer to the question would be to use group in your Gemfile like gem 'pg', group: [:development, :production] gem 'sqlite3', group: :test

Categories : Ruby On Rails

How to Route Multiple Pages to 'Edit' a Users Account Information (Rails)
Split the form up into separate .html.erb files (like email.html.erb and password.html.erb) and in your controller write something like: def edit ... if params[:email] render 'email' end if params[:password] render 'password' end end Obviously the conditions can be whatever you want.

Categories : Ruby On Rails

Rails encrypt Database password in database.yml for SQL-Server
You can use Crypto gem for that encrypted_password = Crypto.encrypt(password, 128_character_key, 128_character_iv) To decrypt use password = Crypto.decrypt(encrypted_password,same_key,same_iv)

Categories : Ruby On Rails



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.