php-general Digest 5 Feb 2006 13:39:23 -0000 Issue 3946

Topics (messages 229884 through 229894):

Re: system('bell'); ?
        229884 by: Kevin Waterson

Re: PHP hosting with multiple domains?
        229885 by: Peter Hoskin

Re: need help to update a mysql table from dynamic form
        229886 by: Sumeet

Re: Arrays
        229887 by: Hugh Danaher

Re: Using API in other languages
        229888 by: Eli

Reverse Engineering of Smarty
        229889 by: Zareef Ahmed
        229890 by: Max Schwanekamp
        229894 by: Rory Browne

Help with mysql_query and INSERT INTO
        229891 by: Colin Davis
        229892 by: Johan Martin

Re: xml to array
        229893 by: Tod Thomas

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
This one time, at band camp, tedd <[EMAIL PROTECTED]> wrote:

> Interesting! The statement system('bell'); is new to me.
> 
> If I'm writing code on a hosted domain, and using that statement, 
> who's bell am I ringing?

The server bell, not the client.
I used this method because the cash drawer was plugged into the server in a 
shop front.
each of the terminals could then use a web based POS interface but there was 
only a
single cash drawer.

Kevin

-- 
"Democracy is two wolves and a lamb voting on what to have for lunch. 
Liberty is a well-armed lamb contesting the vote."

--- End Message ---
--- Begin Message ---
Russell Jones wrote:
Host-Gator has a fantastic, cheap reseller program, although you aren't
sharing space within 1 account.
My real recommendation would be ServerPronto though. $29.95/mo for a
dedicated with 40gig space.
Lovely cogent bandwidth too... you get what you pay for, which in this case is almost nothing.

ServerPronto/Infolink have also been listed for spam on several occasions.

Being a former customer, I don't recommend them at all.
 It works great for me, and you can host all the
domains you want. You will have to learn how to use Apache, though.

Russ


--- End Message ---
--- Begin Message ---
Patrick Aljord wrote:
could someone please help me on that one? http://hashphp.org/pastebin?pid=6156

basically this is how I do:
I display a mysql table in an html table and I put each value in an
input text box.
At the bottom I put a submit button to update changes.
My question is how do I update everything knowing that I don't know in
advance the name of all the input textbox?

Here is the code to display the table:
 <table width=\"1\" border=\"1\">
   <tbody>
     <tr>
       <td><strong>English</strong></td>
       <td><strong>Fran&#231;ais</strong></td>
       <td><strong>Espa&#241;ol</strong></td>

     ";
 $getdisplaycatname = "select
catid,categoryfr,categoryen,categoryes,categoryar from category";
 $getdisplaycatnameq = mysql_query($getdisplaycatname);
 while ($getcatrow = mysql_fetch_array($getdisplaycatnameq)){
 //$display_category=mysql_result($getcatnameq, 0);
 $showcatid=$getcatrow['catid'];
 $showcat=$getcatrow['categoryfr'];
 $showcaten=$getcatrow['categoryen'];
 $showcates=$getcatrow['categoryes'];
 echo "  <tr>
       <td> <input type=\"text\" name=\"<????>\" value=\"$showcaten\"
size=\"18\"/></td>
       <td> <input type=\"text\" name=\"<????>\" value=\"$showcat\"
size=\"18\"/></td>
       <td> <input type=\"text\" name=\"<????>\" value=\"$showcates\"
size=\"18\"/></td>
     </tr>
  ";
 }
 echo "
 </tr>
   </tbody>
 </table>
 <br /><input type=\"submit\" name=\"update\"  value=\"update\" /></form>

 ";
 thanx in advance

Pat


not sure of exactly u r try to do...but i can suggest the following code.

while ($getcatrow = mysql_fetch_array($getdisplaycatnameq)){

  /* assuming getcatrow is an array like
   getcatrow = array( "field1" => "value1",
                      "field2" => "value2");
        
 */

  while( list($key,$value) = each($getcatrow) ) {
        echo "<input type='text' name='$key' value='$value'
> size='18'/>";

  }

}

u can then complete the code....

--
Sumeet Shroff
http://www.prateeksha.com
Web Design and Ecommerce Development, Mumbai India

--- End Message ---
--- Begin Message ---
Philip,
You'll often get an error call on a line when there is a problem on the previous line. Say, you forgot to end a line with a semicolon, then it will error the next line.
Hugh
----- Original Message ----- From: "Philip W." <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Saturday, February 04, 2006 11:12 AM
Subject: [PHP] Arrays


Sorry if this question seems stupid - I've only had 3 days of PHP experience.

When using the following string format, I get an error from PHP.

$text['text'] = "String Text" ;

Can someone help me?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.15.1/250 - Release Date: 2/3/2006





--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.15.1/250 - Release Date: 2/3/2006

--- End Message ---
--- Begin Message --- Is there any other way of doing this without technology like web services? mabye a glue extension between those languages?


Rory Browne wrote:
> I could be wrong on this, but I think your best hope is something
> using web services like SOAP, or XML-RPC.
>
> On 2/4/06, Eli <[EMAIL PROTECTED]> wrote:
>
>>Hi,
>>
>>I have a class in PHP which offers some API functions. I want to access
>>this API with other languages (such as C/C++, Java, Perl, etc), so the
>>functions will run from PHP.
>>How can I do that?
>>
>>-thanks.
>>

--- End Message ---
--- Begin Message ---
Hi All, 

 Accidentally I got deleted all of my php code in one of my application, I was 
using smarty and its compiled directory has the code in its native format.

Is there any way so I can do some type of reverse engineering to bring back my 
original code?

Any suggestion?

Thanks in advance.

Zareef Ahmed

--- End Message ---
--- Begin Message ---
Zareef Ahmed wrote:
 Accidentally I got deleted all of my php code in one of my application, I was 
using smarty and its compiled directory has the code in its native format.
Is there any way so I can do some type of reverse engineering to bring back my 
original code?

No, Smarty's compiled PHP is strictly for the output. There is little connection (or there shouldn't be anyway) between your application php and the compiled php that Smarty produces when it parses a template file.

--
Max Schwanekamp
http://www.neptunewebworks.com/

--- End Message ---
--- Begin Message ---
If you don't have backups, then:

 1: Why do you not have backups?
 2: Are you insane?
 3: What filesystem, and file recovery techniques have you researched/attempted?
 4: Why do you not have backups?
 5: Are you insane?

--- End Message ---
--- Begin Message ---
I need to insert a new record into a MySQL table which has an auto_increment 
field Ref as the primary index.  When I have inserted the new record, I need 
to get the new Ref value in order to name some files to relate to the 
record.  At the moment I have to do a SELECT command and search for another 
field (Title) which might not be unique.

Is there another way that I get the Ref back after an INSERT?

When I use mysql_query with INSERT INTO it only returns true or false, 
rather than the row.  The PHP manual says:

Return Values
For SELECT, SHOW, DESCRIBE or EXPLAIN statements, mysql_query() returns a 
resource on success, or FALSE on error.
For other type of SQL statements, UPDATE, DELETE, DROP, etc, mysql_query() 
returns TRUE on success or FALSE on error.

Regards
Colin Davis

--- End Message ---
--- Begin Message ---

On Saturday, Feb 4, 2006, at 07:22 America/Los_Angeles, Colin Davis wrote:

I need to insert a new record into a MySQL table which has an auto_increment field Ref as the primary index. When I have inserted the new record, I need
to get the new Ref value in order to name some files to relate to the
record. At the moment I have to do a SELECT command and search for another
field (Title) which might not be unique.

Is there another way that I get the Ref back after an INSERT?

When I use mysql_query with INSERT INTO it only returns true or false,
rather than the row.  The PHP manual says:

Return Values
For SELECT, SHOW, DESCRIBE or EXPLAIN statements, mysql_query() returns a
resource on success, or FALSE on error.
For other type of SQL statements, UPDATE, DELETE, DROP, etc, mysql_query()
returns TRUE on success or FALSE on error.

Regards
Colin Davis


http://www.php.net/manual/en/function.mysql-insert-id.php
This will give you the record id of the last record inserted (or created).




Johan Martin
Catenare LLC
534 Pacific Ave
San Francisco, CA. 94133
Phone: (415) 834-9802
Fax: (415) 294-4495
http://www.catenare.com

AOL: catenarellc
Yahoo: martin_johan
MSN: [EMAIL PROTECTED]
GTalk: [EMAIL PROTECTED]

FWD: 716798

--- End Message ---
--- Begin Message ---
Brian V Bonini wrote:
On Fri, 2006-02-03 at 16:23, Richard Lynch wrote:

I've got my money on the XML spec REQUIRING an alphabetic start to
tagnames, and subsequent characters can be alphanumeric...

In other words, it doesn't work because <0> is not a valid XML tag.



Yeah, that was my instinct too... Just could not find anything to
confirm it after a quick browse through the spec. Though can you find
anything in the spec via a quick browse.. ;-)

However, after a closer look I still can't find (at least in plain
English) anything that says this is NOT OK. Though the parser does
return '[xml_error] => not well-formed (invalid token)'.

Good stuff....

-Brian



Just a quick shot it the dark...

http://www.w3.org/TR/REC-xml/#NT-Name

Go up about a half page to this:

"[Definition: A Name is a token beginning with a letter or one of a few punctuation characters, and continuing with letters, digits, hyphens, underscores, colons, or full stops, together known as name characters.] Names beginning with the string "xml", or with any string which would match (('X'|'x') ('M'|'m') ('L'|'l')), are reserved for standardization in this or future versions of this specification."...

From quick read maybe if you wrap the numbers in quotes that might work?

--- End Message ---

Reply via email to