Mysql table_creation helpers - mysql

I want to make an app which allows to create a table by using returned user input. For example when you go to my website and fill in a website name I want it to create a table which corresponds this website name.
Another question would be how to make this user input make a subdomain to my current domain like:
yourURL.MyURL.com

u can simply use create_table method from ActiveRecord::Migration, but i don't think that this is a good way. To deal with subdomains u can read and watch nice railscast about that http://asciicasts.com/episodes/221-subdomains-in-rails-3

Related

How to add manage temparory data in DotnetNuke?

I am beginner in DNN. I am creating a module which provides Login, Dashboard and Add-Update Form. I have data in JSON format. I want to store it temparory while user use the website. Data will be destroy as soon as user will close the website.
Currently I have created a folder in my Solution Explorer of project in Visual Basic and created 3 .json files which stores login_info.json, basic_info.json and auth_info.json. I write json data whenever user login and I make it blank when user logout.
Above method is working fine now but I afraid it will work when I will publish this module.
Also I may have situation where I need to store image some where. I don't know how I will manage.
Can anybody please guide me?
Is this proper way to store data temparory in DNN?
Is there any other better way?
After getting one of reply for Database Suggestion
Is there any table which same as User Meta in DotnetNuke?
You use the ConnectionString that is used by DNN and access the database as you would normally.
DotNetNuke.Common.Utilities.Config.GetConnectionString()
Or you can use the Data Access Layer that the DNN Framework supplies. For that take the Christoc Templates. In there is all you need to communicate with the DB.

Displaying text directions with setPanel() using My SQL

Hello I m trying to make an app using the tutorial here. https://developers.google.com/maps/documentation/javascript/examples/directions-panel.
the question I want to ask if is it possible to have values from a mysql database in the select box. (The destination) . Also if its possible The start value to be the location of the user that uses the app.
sorry if these are easy questions but I m fairly new to programming and I dont know where to start.
If you look at the HTML the elements added to the drop down list are down list are done so from the html, you will need to query your back-end database for the locations you want and pass them to the javascript (I am unsure what language you are using in your backend) if you're using php then this answer should help: Fetching data from MySQL database to html dropdown list
If you want the start point to always use the users location I would suggest a solution such as:
var location = navigator.geolocation.getCurrentPosition();
var start = new google.maps.LatLng(location.coords.latitude, location.coords.longitude);
Instead of deriving the start point from the ddl. Not this uses html5 geolocation, may not be accurate and may not work in all browsers.

how to remove result set from html page

I have a MySQL database, and few perl scripts using which i am generating the webpages.
On Html page links are available,
For example-
Customer_link => (calls customers.pl) query executed - select * from customers.
Now there is one more link say Customer_in_mumbai => it should remove all the customers whose city is not mumbai.
How to achieve that?
do i need to execute the query once again with where clause or any other way is also possible so that i can simply remove the customers whose city is not mumbai?
Also if i need to execute the query again, do i need to write one more perl file, if not how can i use the same file?
You can use Javascript to manipulate on the client side of things after it's been loaded/displayed. There's nothing you can do on the server side to change a page once it's been downloaded without Javascript.
The rest of your questions indicate a lack of familiary with how dynamic web pages are generated. You can have a single page that does all that, using standard HTTP query variables to modify how the script operates. e.g.
http://example.com/yourscript.pl?remove=mumbai
then have Perl retrieve that remove value and use it to modify how the database query runs. But showing you that is beyond the scope of this site - we're not here to teach you, just help fix problems.
From your question, it seems you only want to remove it from the page temporarily for the user. You can achieve that simply by remove rows with mumbai as a value with Javascript. That should save you server side processing. Use a Library like JQuery to achieve it easily.

Add A Background

I was wondering if there was any way of changing the background in access. The standard grey is ok but I would like to change it to an image that shows instructions or what was updated last. Also, if I can allow a user to change the background to an image of their choice that would be cool as well.
Can this be done
To be honest, I'm not sure if this is possible or not, but if it is, I'd advise you not to do it. Why?
Users will expect instructions under a help menu or on an intro
splash form
They will expect info. like what was updated last to appear in more
conventional places like the status bar
Allowing users to personalise your application with their photos can
make your application look pretty bad and increase load times.
Only advice though - good luck with it!
I have been able to allow users to change the background of the database. It works great and it works no matter what computer they log onto the database from. I did have a problem with remote users so I added a macro that allows them to disable the functionality. It works great. It was a little complicated to se up initially. Some of the modules below may have more stuff contained in them then what is needed for the purpose of this question. But here is what I did to make it work:
Add the Following modules to your database: modChangeMDI, SetBackgroundImage, and clsCommonDialog
Link to a zip file containing the code for the above modules: http://www.filedropper.com/changebackgroundimage
You can set the default location that a users sees when the search for file dialog pops up. This is located in the ThisFileToOpen function of the SetBackgroundImage module.
clsCommonDialog <-- Used to open the find file dialog box
modChangeMDI <--Used to change the background image
Create a table called $BackgroundLocation with the following fields. On my database this is contained in the backend database.
ID (AutoNumber, Primary Key)
UserID (Text, Required, 250 in length, don't allow zero lengths)
BackgroundLocation (Text, 255 in length, not required)
DisableBackground (boolean)
Create an AutoExec macro and add an action that runs the code SetTheBackgroundPictureOnStartup (1)
Create a BackgroundDisableEnable macro and add an action that runs the code DisableEnableBackground()
Create a BackgroundSet macro and add an action that runs the code SetTheBackgroundPictureOnStartup(2)
Then assign the BackgroundDisableEnable and the BackgroundSet macro to their own menu item.
When the database opens it will run the AutoExec by default.
You can use a start-up form as I suggested above. You can even base the start-up form on a comments table that can be edited by the users and will display the most recent and / or relevant information. The form can be displayed at start-up and then referred to at any time by the users.
In the past, I have included a ? button on forms that open such a form at the relevant page.

Store web address in MySQL and display as link in HTML

I am a PHP newbie, but I'm making progress. I have made a small mysql database and PHP form that I am using to populate a web page that shows the upcoming gigs for a musician. It shows the date, venue, etc. and works fine.
What I'm trying to add is this: I want to be able to store the web address of the venue in the database and then use that address as the href for and anchor tag that says VENUE INFO. I've called the column maplink and set it up like all my other variables. When I insert the web address in my form it gets recorded to my database as text "maplink" (no quotes) instead of the web address that I entered.
Also the HTML I'm trying to use is
<p>VENUE INFO</p>
which I'm sure is terribly wrong.
I'm using PHP 5.3.8 and MySQL 5.5.16. Any help on how to go about this?
During insert into the database, you may have forgotten to append $ symbol to maplink to make it a variable.