Writing query for form in Joomla [closed] - joomla

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I am a beginner with Joomla. I am using template sitegroundJ16-2. I designed a form for around 9 text fields. I also made a table in the database. Now I want to write a query to connect to database to insert data in the dbase and retrieve data.
I am not able to figure out where to write query.
In the article where I designed that form? Where can I locate my articles in directory structure?

The code to connect to the database is:
$db = & JFactory::getDBO();
The code to insert a query would be something like this:
$query = "INSERT INTO `#__yourtable` (`firstname`, `lastname`) VALUES ('$firstname', '$lastname');";
$db->setQuery($query);
The code to retrieve information from a database could be something like this:
$query = 'SELECT * FROM #__yourtable ORDER BY id DESC';
$db->setQuery($query);
You won't be able to add this to a Joomla article, you will either need to create a component or find a free one and adapt it as GDP said, or create a module and embed it in an article.

In spite of the very broad nature of your question, you'll need to write a component for joomla. A starting point Hello World would be the logical starting point, but I'd suggest finding and downloading a similar extension and modifying that. If it's just a form that you're looking to create, I'd strongly recommend one of the free extensions that do that for you that can be found at the JED.

Related

How to get the downloadable products link collection order by title [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I am struggling from last two hours to get the all downloadable product links order by title, but not able to achieve because it's giving the wrong order by collection.
Can anyone help me :D
You can get the all downloadable collection by
$products = Mage::getModel('downloadable/link')->getCollection();
but when you try to add the title in this collection using
$products->->addTitleToResult();
then this will automatically add two sorting order one by sort_order ASC and second one by title ASC. So that you will never get the actual sorting result because sort_order always come first. For more details see
Mage_Downloadable_Model_Resource_Link_Collection::addTitleToResult()
So you need to override the above class in your local pool and need to remove
->order('main_table.sort_order ASC' from addTitleToResult()
or create a custom class for the same.

Passing Arguments in Windows Application [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I am making a application(desktop app), and need to fetch ids from DB and pass these ids to another desktop application.
How to achieve this?
Your question is your answer. You can use command line argument passing in windows application. As to how to do this is written below.
You can Create a process and call the application to start and pass those arguments:
Process pro=new Process();
pro.StartInfo.FileName = #"ApplicationName.exe";
pro.StartInfo.Arguments = arg1 + " " + arg2;
pro.Start();
pro.WaitForExit();
in the second application get these values by following the below code:
var arguments = Environment.GetCommandLineArgs();
if (arguments.Length > 1)
{
productIdFirst = Convert.ToInt32(arguments[1]);
productIdSecond = Convert.ToInt32(arguments[2]);
}
If I understand you correctly then you're talking about a website and you could pass it a query string. If that is the case then you should check out http://msdn.microsoft.com/en-us/library/system.web.httprequest.querystring.aspx :)
I agree to Martim, that it is no clear if your tags "Windows" not perhaps mean "Website". But if you really mean "Windows" like you've tagged, you can use COM as Middleware. A german article already has great explanation with code samples. Languages can be translated.
http://www.activevb.de/tutorials/tut_middleware/middleware.html
Download Source Code
http://www.activevb.de/tutorials/tut_middleware/downloads/Middleware.zip

Renaming Document type once app is in the wild [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I have an document based application with a custom document type.
Any idea how to rename that type once the application has been release, so that the old files are treated the same?
Thanks!
The easiest way is to support both document types, saving only as the newer one. Sooner or later, the older document type will be (mostly) replaced with the newer one.
You can also automatically re-save the older type of document whenever users open it.
Note that resaving documents may have side effects if the file name extension has also changed, because users may have symbolic links to existing documents. The same side effects apply if you brutally search the user home folder to rename all existing documents of the older type. I wouldn't recommend it.
The first approach is just fine, I think, because even if users notice the change, they will attribute it to a file format change or something like that. The biggest downside is that you have to support both document types literally forever.

Need some explanations on this Delphi code [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
I have this code and need some explanation on these questions:
What is that trailing "_TLB" after "ShellExecHookXample" in first uses section?
How should I use this code in Delphi 7 and make stand-alone exe file? (I don't know what's the proper place to put codes and call its method. Since it seems to be a unit or what?)
if possible please describe the code for me.
Thanks in Advance.
The _TLB is stands for type library. It looks like you are trying to implement IShellExecuteHook.Execute and have so far found some code here. However, I'm guessing because you didn't tell us. You are likely to get better answers if you are able to to spend more effort describing what it is you are trying to achieve.
If my guess is correct you should take a look at this question: IShellExecuteHook.Execute which I believe will explain how to solve your actual problem.
ShellExecHookXample_tlb means that this unit was imported from com (activex) object with an internal delphi tool (Project->Import type library...)
it reads public methods,events, properties of com (activex) object and generates pas unit with appropriate classes/interfaces. Usually you can find it in delphi folders.

how stackoverflow is making url [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
i need to know how stack overflow is creating the url in name of title as an page..
if i ask an question as how stackoverflow is making url is it creating an page for that question or it is coming from db ..if it is from db how it is done....
It's called URL Rewriting, done specifically for the purpose of search engines.
At a guess, I'd say that the ACTUAL url that is being called (logically) is something like this:
stackoverflow.com/questions/index.php?id=4591366
The text bit probably is only to make identification easier, especially for search engines.
That index.php probably loads the question identified by that id, which in this case, is your question.
http://stackoverflow.com/questions/4591366/how-stackoverflow-is-making-url
4591366 - ID of question
how-stackoverflow-is-making-url - a String made from subject after processing it correctly how stackoverflow is making url
while retrieving Question id only is enough, while subject will help in SEO stuff
The number is the primary key. The part afterwards is ignored when processing actual requests. So:
http://stackoverflow.com/questions/4591366/
and
http://stackoverflow.com/questions/4591366/made%20up
both work.
However, links and redirects are generated that way (by including the title) for search engine optimization.
StackOverflow uses ASP.NET MVC Routing to achieve its URLs.
They would be using a Routing Map similar to this:
"{question}/{id}"
Then in the URL they just add the title of the question which gets ignored by their routing logic but gets used for Search Engine Optimisation.
Source: Hanselminutes Podcast 134 - StackOverflow uses ASP.NET MVC - Jeff Atwood and his technical team, http://www.hanselman.com/blog/HanselminutesPodcast134StackOverflowUsesASPNETMVCJeffAtwoodAndHisTechnicalTeam.aspx

Resources