Jump to content


gizmola

Member Since 06 May 2003
Offline Last Active Apr 02 2016 05:29 PM

Posts I've Made

In Topic: ANALYZE/ OPTIMISE in MYSQL

16 March 2016 - 05:18 AM

The answer really depends on the engine, but the basic idea is that analyze looks at key distribution in the table and updates some statistics in the data dictionary so that the query optimizer can make informed decisions in regards to when it should use an index or ignore it.

 

Optimize is basically analyze+ some table restructuring, but this again is highly dependent on the storage engine.  Innodb doesn't typically need analyze, as it has statistical updates baked in.  By the same token the way data is stored in innodb vs myisam is completely different, so there's literally nothing common between engines, and that certainly is true of the other engines that have come along in Maria etc.


In Topic: GET url from ID

04 March 2016 - 07:06 PM

the uniqid gives each line there own id eg.

<option id='56d9c29d9332e' value='http://localhost/files/file.zip'>file.zip</option>
<option id='56d9c29d93830' value='http://localhost/files/file.zip'>file.zip</option>
<option id='56d9c29d93f0b' value='http://localhost/files/file.zip'>file.zip</option>
<option id='56d9c29d93f43' value='http://localhost/files/file.zip'>file.zip</option>

users can see the directory where the file is hosted so I am trying to use GET to find the id of the chosen file and start download of that file.

 

 

Yes, we understand this simplistic code.  The problem is, that it doesn't seem you do.  

 

There is code here that you are apparently using, which you did not write and that needs to work on the form submission that you've also omitted from your code.

 

Jacques went ahead and jumped to the solution that most people use, but again we don't know what this app of yours is supposed to be doing or why.  

 

It's reading a temp? file, that has some format of lines, then spitting that out again in the form of a dropdown list, to then be processed, and to what end?  How is the temp file created and why is it created?

 

We don't like cryptic mysterious threads like this that waste our time.  Just looking at the code you provided, I have little doubt that everyone here will find that there are better ways to do this, but since it seems you are trying to use something someone else wrote (we have a different subforum for that as well --- see 3rd party scripts) you should at least start with listing what you started with and where you got it from.  


In Topic: GET url from ID

04 March 2016 - 05:56 PM

You are not providing enough information for anyone to help you with this.

 

First off unique() is a function that returns a unique value.  How is this of use to you in this scenario?

 

Obviously it would be simple enough to change this line:

 

$print = print "<option id='$up_id' value='$url'>$doesnt_start_with_numbers</option>\n";

 

To this:

 

$print = print "<option id='$up_id' value='$up_id'>$doesnt_start_with_numbers</option>\n";

 

However, I don't see how that would allow anyone to select or identify a specific file from the drop down list.


In Topic: better understanding of LAMP Stack through Reverse-Engineering Application

05 January 2016 - 12:48 AM

I understand that you have a small time tracking app, but that is not going to jibe with Time trex other than they both offer some level of time tracking.  

 

If what you are saying is that you are trying to understand the time tracking app you had built, then we would need to know more about that specific application.  There isn't a universal way these things work. 

 

If the app was built with a specific framework, then there are frequently tell tale signs of that, but we can't guess.

 

Obviously you want to start with an index.php assuming that exists.  What does that include/require and where does it go from there.  Are there rewrite rules that come with it?

 

Most well built web apps have some form of MVC pattern, so there's typically a controller, with separate db model classes and views/templates that are loaded as needed by the controller.


In Topic: Trouble with foreign keys

04 January 2016 - 04:51 AM

The message is telling you that there is no matching categories.id value for the transactions row you are trying to add.  A row with whatever id you are trying to specify in your insert must exist in the categories table.  This is how foreign keys work.