Search found 37 matches

by mammal
Tue Jun 28, 2005 11:51 pm
Forum: PHP coding => General
Topic: Please help. Im new to PHP
Replies: 17
Views: 3959

Syntax Question?

I appreciate my explanation was a little simple, however I was more concerned in solving the problem for the guy rather than have a discussion about syntax. The point I was trying to make was that my script worked and the criticism that using <?php or echo was not the reason the script wasnt working.
by mammal
Tue Jun 28, 2005 3:40 am
Forum: PHP coding => General
Topic: Please help. Im new to PHP
Replies: 17
Views: 3959

Variables

You need to use $ instead of &. You are simply printing variables to a html page - all PHP variables have a dollar sign at the front. In addition you don't need to write echo in this case - you can do this instead: <html> <head> <title>test</title> </head> <body> <? $firstVar = "test 1"...
by mammal
Wed Nov 26, 2003 8:32 am
Forum: PHP General
Topic: Possible to retrieve values from XML using PHP?
Replies: 2
Views: 1042

I found this rather helpful article that seems easy to understand:

http://www.zend.com/zend/tut/tutbarlach.php
by mammal
Wed Nov 26, 2003 5:28 am
Forum: PHP General
Topic: Possible to retrieve values from XML using PHP?
Replies: 2
Views: 1042

I don't know although I'd like to.

I know you can assign xml span tags as PHP variables like so:

<? $id = "<span datafld=\"ID\"></span>"; ?>

Although the value of the span result is not captured, so you can't use the php variable as links or anything...
by mammal
Mon Nov 24, 2003 12:10 pm
Forum: mySQL & php coding
Topic: Should I separate tables by month or year
Replies: 2
Views: 679

Thanks for reply, I'm using SQL Server but I'm pretty sure it's the same for both. It's all a learning experience isn't it!

Thanks again!
by mammal
Mon Nov 24, 2003 8:32 am
Forum: mySQL & php coding
Topic: Should I separate tables by month or year
Replies: 2
Views: 679

Should I separate tables by month or year

Although this question can also relate to other databases, I was wondering if an expert might let me know if it's worth separating large db tables by date. i.e. Does it save resources by classing tables such as: db_table_aug_2003, db_table_sep_2003 or simply put all in one table and add a month and ...
by mammal
Mon Nov 24, 2003 1:05 am
Forum: PHP coding => General
Topic: customize error page
Replies: 7
Views: 1763

Try this link, you need a server file to create custom 404 page not found pages.

http://www.icthus.net/CGI-City/tut_htaccess4.shtml
by mammal
Fri Nov 21, 2003 2:44 am
Forum: mySQL & php coding
Topic: need help coding, to interact with my odbc database.....
Replies: 2
Views: 1082

Odbc is not too different from using a direct mysql or mssql connection. I use odbc every day now and my company plumped for that method. The only annoying thing is you may need to find other methods of doing certain things depending on what odbc drivers are installed. Commands like odbc_fetch_array...
by mammal
Thu Nov 20, 2003 6:32 am
Forum: PHP General
Topic: odbc_prepare
Replies: 2
Views: 844

odbc_prepare

Hmm, that's sort of what I thought, although on a well debugged project surely odbc_prepare is useless.

There is nothing on google about it apart from the short PHP manual description about 100 times!
by mammal
Thu Nov 20, 2003 4:34 am
Forum: PHP General
Topic: odbc_prepare
Replies: 2
Views: 844

odbc_prepare

Can anyone tell me what the use of odbc_prepare is.

Does it make the query quicker?

Thanks in advance...
by mammal
Tue Nov 18, 2003 4:52 am
Forum: mySQL & php coding
Topic: NOOB NEEDS HELP FROM PROFESSIONALS
Replies: 8
Views: 2101

This may help, if not...link?

Still pretty confused, perhaps a link will help... Possible solutions: <input type="text" name="table" value="<?=$table; ?>" /> This will display the $table variable within the text field. If you want to fill a select box with previously chosed tables, this may need cookies. Again, a link or screen ...
by mammal
Tue Nov 18, 2003 3:09 am
Forum: mySQL & php coding
Topic: NOOB NEEDS HELP FROM PROFESSIONALS
Replies: 8
Views: 2101

Is it me?

Perhaps it's just me but I can't work out what the issue is, do you mean the variable called $table is lost somewhere along the way?

Do you mean that you write the table name in a textbox and when you do another search the table name is not in the textbox anymore?
by mammal
Tue Nov 18, 2003 1:38 am
Forum: mySQL & php coding
Topic: NOOB NEEDS HELP FROM PROFESSIONALS
Replies: 8
Views: 2101

Show me your code

Perhaps some code would be useful at this point. Doesn't sound like a tricky problem...
by mammal
Tue Nov 11, 2003 7:25 am
Forum: JavaScript
Topic: Setting text to a textbox in a form
Replies: 2
Views: 2018

Use this code...

Use this - all tested.... <script language="javascript"> <!-- Begin function FillTextArea () { var selection = document.MyForm.MySelectBox.value; document.MyForm.MyTextArea.value = selection; /* If you want to add the values on, use: var selection = document.MyForm.MySelectBox...
by mammal
Tue Oct 07, 2003 12:01 pm
Forum: PHP General
Topic: Releasing New Versions of a Self-Written PHP application
Replies: 5
Views: 1254

Releasing New Versions of a Self-Written PHP application

Does anyone have any tips on cataloging new versions of a web application and swopping easily between one version and another. i.e. PHPApplication 1.0, 1.12 etc. Need to get organised with releasing new versions and backing up old versions in case of new bugs and being able to view different version...
by mammal
Fri May 02, 2003 8:03 am
Forum: PHP coding => General
Topic: significant figures adding a leading 0
Replies: 2
Views: 853

String Length

try this:

$number_length = strlen($i);
if ($number_length < 2) { $i = "0$i"; }
by mammal
Fri May 02, 2003 7:53 am
Forum: mySQL & php coding
Topic: Multiple COUNT queries
Replies: 2
Views: 1023

I want it to count distinct fields, this will not do that.

Thanks anyhoo
by mammal
Thu May 01, 2003 7:13 am
Forum: mySQL & php coding
Topic: Multiple COUNT queries
Replies: 2
Views: 1023

Multiple COUNT queries

I'm trying to count the distinct fields within two tables, but my script keeps timing out. Any ideas:

SELECT COUNT(DISTINCT table1.fieldname) AS table1, COUNT (DISTINCT table2.fieldname) as table2 FROM table1, table2

Ideally I want one total but two would do. Any ideas?

Thanks in advance
by mammal
Mon Apr 28, 2003 3:12 am
Forum: PHP General
Topic: Microsoft SQL Server
Replies: 1
Views: 882

Microsoft SQL Server

Can anyone give me some advice on how to sort out my php.ini file to accept connection with a MS SQL Server (NT - IIS).

I understand there are dll files needed?

I keep getting the error message:

Fatal error: Call to undefined function: mssql_connect()

Thanks in advance
by mammal
Fri Apr 11, 2003 2:41 am
Forum: PHP General
Topic: php.ini
Replies: 1
Views: 911

php.ini

Is it true that is I place a php.ini file in the directory where my php scripts are that this will override the settings in the root directory? I'd like to change my own php settings but do not have regular access to the default php.ini file. If it is possible to do this, do I need to change any set...
by mammal
Thu Apr 10, 2003 12:21 am
Forum: PHP Scripts
Topic: bilingual site, url link redirecting to proper directory
Replies: 2
Views: 1452

You could set a cookie once they've chosen their preference such as: <? // $HTTP_GET_VARS[$language] = "en" or "" session_start(); ## Register the input with the value if ($HTTP_GET_VARS[$language] && !$HTTP_SESSION_VARS[Language]) { $Language = $HTTP_GET_VARS[$language]; ## Create new Session Value...
by mammal
Tue Apr 08, 2003 10:14 am
Forum: mySQL & php coding
Topic: Having problems processing a form
Replies: 4
Views: 1446

Yup

Yeah you do! Otherwise the SQL wouldn't know where to put it.

By the way, do you use an SQL front-end like phpMyAdmin. Its easily compilable and is useful for testing scripts.

Check this out sometime:

http://www.phpmyadmin.net/

Glad your code works now...

Mammal
by mammal
Tue Apr 08, 2003 9:25 am
Forum: mySQL & php coding
Topic: Having problems processing a form
Replies: 4
Views: 1446

SQL Reserved Words

Hi Amp, your script looks fine but I'm pretty sure that "From" and "To" are SQL reserved words. This means you cant name databases, tables or columns "from" or "to". Try renaming those columns and see what happens, I'm pretty sure it will work. I had the same problem six months ago when I tried to c...
by mammal
Fri Apr 04, 2003 5:49 am
Forum: PHP General
Topic: XML PHP
Replies: 2
Views: 1054

Excellent Thanx
by mammal
Fri Apr 04, 2003 2:31 am
Forum: mySQL & php coding
Topic: Problem with if & else statements (I think)
Replies: 4
Views: 1418

No worries

Thanks amp, if you get stuck in future feel free to email me.

Mammal