You are trying to use the variable cust_id
before giving a value. This may be because of a logical mistake, or because you got the indentation wrong – remember that if the variable is defined in a function, it is in local scope, meaning that it’s not accessible from the outside. If you can’t get it to work, try to edit your post to let it show proper indentation (read About the Users category) and we can debug it