Solved: PHP: Does this work?

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

jagonzalez

Thread Starter
Joined
Aug 14, 2013
Messages
8
Good night,

I have this routine that reads the table Laser with two fields and then passes that data to an array arreglolaser. Is this routine correct? How can I verify if it's working all right?



function busca()

{
var n99 = document.form1.laserausar.value;

<?php
$i = 0;
$sql="select * from Laser";
$resultlaser= mysql_query($sql) or die(mysql_error());
$row=mysql_fetch_array($resultlaser);
while($row=mysql_fetch_row($resultlaser))
{

$arreglolaser [$i][0] = $row['1'];
$arreglolaser [$i][1] = $row['2'];

$i = $i + 1;
}
?>
}

Thank you,
JAG
 

JiminSA

Jim
Joined
Dec 15, 2011
Messages
3,407
No, this would not work, because ...

There are two distinct work areas involved on websites:
Client-side (CS) - which operates locally within your browser on the user's machine.
Server-side (SS) - which operates remotely on the ISP's machine(s) - (Internet Service Provider).

Generally speaking, the browser handles the interface between the two areas, but for all intents and purposes, no single language operates in both.

CS languages - Javascript; ActionScript etc., *HTML and *CSS (* markup scripting languages not programming languages)
Uses:-

Make interactive webpages.
Make stuff happen dynamically on the web page.
Interact with temporary storage, and local storage (Cookies, localStorage).
Send requests to the server, and retrieve data from it.
Provide a remote service for client-side applications, such as software registration, content delivery, or remote multi-player gaming.


SS languages - PHP, C++, C#, Java, etc.,
Uses:-

Process user input.
Display pages.
Structure web applications.
Interact with permanent storage (SQL, files).

This said, you would need to put your PHP code into your form1 action script. (i.e. the script designated in the action="???" part of your <form> tag.)
 

colinsp

Colin
Joined
Sep 5, 2007
Messages
2,356
Also you should not be using mysql commands these are deprecated. You should be using mysqli or pdo for your mySQL queries.
 

jagonzalez

Thread Starter
Joined
Aug 14, 2013
Messages
8
I appreciate the comments and the information, I could resolve the issue and get this working.

Thanks!! (y):)

JAG
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top