Search found 192 matches

by victor123
Wed Dec 07, 2005 10:58 am
Forum: mySQL & php coding
Topic: Insert into Date field
Replies: 3
Views: 1617

Hi, Well, if someone chooses 'Anytime' you can modify the query so that it does not use that field. For example: $sql = "UPDATE table SET value = '$val1'... WHERE condition1 AND condition2..." if($var != 'anytime'){ $sql .= "AND condition3"; } If there are no previous conditions, you can use WHERE 1...
by victor123
Wed Nov 16, 2005 9:12 am
Forum: PHP coding => General
Topic: Deleting Files/directories
Replies: 5
Views: 1433

Hi, Are you getting any errors? I don't know if that !empty($dir) at line 11 will work. You may remove it and see what happens. Also you can try and insert line 7 after line 13, so as not to try to delete '.' and '..'. What is remove dir? is it the name of your function? in that case you can replace...
by victor123
Tue Nov 15, 2005 9:57 am
Forum: PHP General
Topic: problem displaying text field (cross join query)
Replies: 3
Views: 1688

Wouldn't it work If you write echo 'Comment'; at the end of the while? Please use the code tags...

Regards.
by victor123
Tue Nov 15, 2005 9:50 am
Forum: PHP coding => General
Topic: Deleting Files/directories
Replies: 5
Views: 1433

Yep. There is no function such as "deltree" so you will have to check recursively if a folder is empty, as in the pseudocode by ruturajv.

Regards.
by victor123
Wed Nov 02, 2005 9:45 am
Forum: mySQL & php coding
Topic: Display event_summary fieldname when a category is selected.
Replies: 0
Views: 1110

Hi,

Insert something like:

Code: Select all

<?php
$event_name = (isset($_POST['event_name'])) ? $_POST['event_name'] : 0;
?>
Gesf gave you the answer in your previous post.

Regards.
by victor123
Sun Oct 16, 2005 11:43 pm
Forum: PHP coding => General
Topic: Renaming a set of files
Replies: 4
Views: 916

Thanks both, mates. I´ll have to do it file by file then...
by victor123
Sun Oct 16, 2005 9:04 am
Forum: PHP coding => General
Topic: Renaming a set of files
Replies: 4
Views: 916

Renaming a set of files

Hi,

Is there a way of renaming a set of files using characters like *? I am trying to do:

Code: Select all

<?php
rename("*.JPG", "*.jpg");
?>
And i get an error saying "Invalid argument". I also used ?.JPG with the same result...

Thanks in advance.

Regards. Victor
by victor123
Fri Oct 14, 2005 2:32 am
Forum: PHP coding => General
Topic: mixing header() with $_POST()
Replies: 2
Views: 884

What i do is to have an error function that composes the error message. Basically, this function displays a different message depending the parameter it receives. Then, if i have an error in a php script, i redirect to the page i want passing via url a parameter (e.g. e=$value). In this page, i chec...
by victor123
Wed Oct 05, 2005 6:33 am
Forum: PHP General
Topic: Need help with Login script...
Replies: 24
Views: 10270

Well, first thing to do is to get a web server and php running. The easiest method is to get a package that contains apache+mysql and install it correctly. Try to download minixampp, google for minixampp download or something and then install it, it is very easy. There is a forum here about installa...
by victor123
Wed Oct 05, 2005 6:25 am
Forum: PHP coding => General
Topic: Some comments on sessions
Replies: 4
Views: 1073

Well... thanks, yes... that's where i got the example from. But i don't manage to get it to work if the user can go from one page to another. It all goes fine in the starting page, but when it goes to another page, i cannot make it work...

Victor
by victor123
Tue Oct 04, 2005 2:15 am
Forum: PHP coding => General
Topic: Some comments on sessions
Replies: 4
Views: 1073

Some comments on sessions

Hi, I am trying to play around with session_set_save_handler and i have some questions: First of all, the syntax i found in the manual is: <?php session_set_save_handler ("open", "close", "read", "write", "destroy", "gc"); session_start(); ?> i found out that the following functions are called autom...
by victor123
Mon Oct 03, 2005 10:53 am
Forum: mySQL & php coding
Topic: Query not running right in php script!
Replies: 4
Views: 1743

Hi,

Try and echo the sql after the error and see what you get.

Regards.
by victor123
Sun Oct 02, 2005 11:20 pm
Forum: mySQL & php coding
Topic: Sorting date time values
Replies: 3
Views: 1619

The last result will be recovered with something like: $sql = "SELECT values FROM table WHERE condition LIMIT 1" It gets the last value that meets the condition. If you just want the last value just remove the condition. You can play also with ASC or DESC to retrieve values in a particular order. Re...
by victor123
Tue Sep 27, 2005 11:51 pm
Forum: mySQL & php coding
Topic: verify username and password
Replies: 4
Views: 1651

Hi, I would not pass username and password in the url. What you can do is to pass an id in the url. That id can be used to retrieve the user/password from the db. That means an extra field in your db. In your code, if (($username == $username) && ( $password == $password)...
by victor123
Tue Sep 27, 2005 11:44 pm
Forum: mySQL & php coding
Topic: help with posting data from form to DB
Replies: 5
Views: 1763

:oops: You are right... that copy-paste stuff sometimes is really dangerous...
by victor123
Mon Sep 26, 2005 11:28 pm
Forum: mySQL & php coding
Topic: verify username and password
Replies: 4
Views: 1651

Hi,

How are the username and password passed from A to B? are they stored in db?

Regards.
by victor123
Mon Sep 26, 2005 11:27 pm
Forum: mySQL & php coding
Topic: GROUP BY clause is showing wrong result or i am wrong?
Replies: 1
Views: 902

Hi,

If you want to recover all the results sorted by the 'branch' field, you should use ORDER BY instead. GROUP BY will only recover the first result found of each value of branch.

Regards.
by victor123
Mon Sep 26, 2005 11:23 pm
Forum: PHP coding => General
Topic: creating a list, searching list
Replies: 6
Views: 1204

Hi,

To enter items into a db have a look at mysql_query(). There are examples in the php manual which you will find useful.

Regards.
[/code]
by victor123
Sun Sep 25, 2005 11:15 pm
Forum: mySQL & php coding
Topic: help with posting data from form to DB
Replies: 5
Views: 1763

Hi, I'd put the php code in the following way: <?php if(isset($_POST['submit'])){ $query = "INSERT INTO `venue` ( `v_pic` , `v_name` , `v_website` , `v_address` , `v_email` , `v_phone` , `v_rating` , `v_style` , `v_desc` , `v_id`)"; $result = mysql_query($q...
by victor123
Fri Sep 23, 2005 6:36 am
Forum: PHP coding => General
Topic: Deleting
Replies: 10
Views: 2659

Hi,

Code: Select all

<?php
$query = "DELETE FROM table WHERE field='$your_field'";
mysql_query($query, $db);
?>


Will delete the entry you want.

Regards.[/quote]
by victor123
Thu Sep 22, 2005 7:23 am
Forum: mySQL & php coding
Topic: Query optimisation
Replies: 4
Views: 1464

Yep. Queries that are not well designed will make the cpu work for more time.

Regards.
by victor123
Thu Sep 22, 2005 7:21 am
Forum: PHP coding => General
Topic: Need Help
Replies: 0
Views: 727

Hi,

At the beginning of second.php you have to put:

Code: Select all

<?php
$name_user = $_GET['name_user'];
?>


By the way, it would be better if you passed variables via POST instead of GET.

Regards.
by victor123
Wed Sep 21, 2005 6:50 am
Forum: mySQL & php coding
Topic: Why and how to use a index?
Replies: 12
Views: 3185

Hi,

The query is ok, why would you want to use an index? the index retrieves an unique value, but if you want to retrieve all the info of a single day then you are fine.

Regards.
by victor123
Wed Sep 21, 2005 6:47 am
Forum: mySQL & php coding
Topic: return results from a search as links
Replies: 0
Views: 1414

Hi,

Would it be something like

Code: Select all

<a href="<?php echo $row['nr'];?>">whatever</a>


Regards.
by victor123
Wed Sep 21, 2005 6:43 am
Forum: mySQL & php coding
Topic: Query optimisation
Replies: 4
Views: 1464

Hi,

I'd go also for a single query, i believe it is faster doing it all in the same query... i have taken some small tests and time has been always less for a single query.

Regards.