i am beginner.

if this error occur ;

Undefined variable: oCustRes

what suppose i do?
i want to use the variable in javascript.
when i define the variable, a database error will occur.
where should i define the variable?
in the javascript or outside?

:(

you can use variable oCustRes in javascript:

<script type=text/javascript>
var oCustRes="Hello World!";
print oCustRes;
</script>

However you can also define oCustRes in PHP by using define function:

define("oCustRes", "Hello world!");
echo oCustRes; // outputs "Hello world."
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.